@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 7f0367109e
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 03:30 UTC

[CI/Build][CPU] Enable cross compilation in CPU release pipeline (#20423)

Signed-off-by: jiang1.li <jiang1.li@intel.com>

Li, Jiang committed Jul 3, 2025 at 20:26 UTC 7f0367109ebb6274e1e5ae7102948ebc730d4e60
3 files changed +27 -9
.buildkite/release-pipeline.yaml
+1 -1
@@ -101,7 +101,7 @@ steps:
101 queue: cpu_queue_postmerge
102 commands:
103 - "aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/q9t5s3a7"
104 - - "DOCKER_BUILDKIT=1 docker build --build-arg max_jobs=16 --build-arg GIT_REPO_CHECK=1 --tag public.ecr.aws/q9t5s3a7/vllm-cpu-release-repo:$(buildkite-agent meta-data get release-version) --tag public.ecr.aws/q9t5s3a7/vllm-cpu-release-repo:latest --progress plain --target vllm-openai -f docker/Dockerfile.cpu ."
104 + - "DOCKER_BUILDKIT=1 docker build --build-arg max_jobs=16 --build-arg GIT_REPO_CHECK=1 --build-arg VLLM_CPU_AVX512BF16=true --build-arg VLLM_CPU_AVX512VNNI=true --tag public.ecr.aws/q9t5s3a7/vllm-cpu-release-repo:$(buildkite-agent meta-data get release-version) --tag public.ecr.aws/q9t5s3a7/vllm-cpu-release-repo:latest --progress plain --target vllm-openai -f docker/Dockerfile.cpu ."
105 - "docker push public.ecr.aws/q9t5s3a7/vllm-cpu-release-repo:latest"
106 - "docker push public.ecr.aws/q9t5s3a7/vllm-cpu-release-repo:$(buildkite-agent meta-data get release-version)"
107 env:
cmake/cpu_extension.cmake
+17 -7
@@ -12,9 +12,8 @@ endif()
12 #
13 # Define environment variables for special configurations
14 #
15 -if(DEFINED ENV{VLLM_CPU_AVX512BF16})
16 - set(ENABLE_AVX512BF16 ON)
17 -endif()
15 +set(ENABLE_AVX512BF16 $ENV{VLLM_CPU_AVX512BF16})
16 +set(ENABLE_AVX512VNNI $ENV{VLLM_CPU_AVX512VNNI})
17
18 include_directories("${CMAKE_SOURCE_DIR}/csrc")
19
@@ -107,10 +106,19 @@ if (AVX512_FOUND AND NOT AVX512_DISABLED)
106 endif()
107
108 find_isa(${CPUINFO} "avx512_vnni" AVX512VNNI_FOUND)
110 - if (AVX512VNNI_FOUND)
111 - list(APPEND CXX_COMPILE_FLAGS "-mavx512vnni")
112 - set(ENABLE_AVX512VNNI ON)
113 - endif()
109 + if (AVX512VNNI_FOUND OR ENABLE_AVX512VNNI)
110 + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
111 + CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.3)
112 + list(APPEND CXX_COMPILE_FLAGS "-mavx512vnni")
113 + set(ENABLE_AVX512VNNI ON)
114 + else()
115 + set(ENABLE_AVX512VNNI OFF)
116 + message(WARNING "Disable AVX512-VNNI ISA support, requires gcc/g++ >= 12.3")
117 + endif()
118 + else()
119 + set(ENABLE_AVX512VNNI OFF)
120 + message(WARNING "Disable AVX512-VNNI ISA support, no avx512_vnni found in local CPU flags." " If cross-compilation is required, please set env VLLM_CPU_AVX512VNNI=1.")
121 + endif()
122
123 elseif (AVX2_FOUND)
124 list(APPEND CXX_COMPILE_FLAGS "-mavx2")
@@ -257,6 +265,8 @@ elseif(POWER10_FOUND)
265 ${VLLM_EXT_SRC})
266 endif()
267
268 +message(STATUS "CPU extension source files: ${VLLM_EXT_SRC}")
269 +
270 #
271 # Define extension targets
272 #
docker/Dockerfile.cpu
+9 -1
@@ -8,6 +8,8 @@
8 # Build arguments:
9 # PYTHON_VERSION=3.12 (default)|3.11|3.10|3.9
10 # VLLM_CPU_DISABLE_AVX512=false (default)|true
11 +# VLLM_CPU_AVX512BF16=false (default)|true
12 +# VLLM_CPU_AVX512VNNI=false (default)|true
13 #
14
15 ######################### BASE IMAGE #########################
@@ -60,8 +62,14 @@ FROM base AS vllm-build
62
63 ARG GIT_REPO_CHECK=0
64 # Support for building with non-AVX512 vLLM: docker build --build-arg VLLM_CPU_DISABLE_AVX512="true" ...
63 -ARG VLLM_CPU_DISABLE_AVX512
65 +ARG VLLM_CPU_DISABLE_AVX512=0
66 ENV VLLM_CPU_DISABLE_AVX512=${VLLM_CPU_DISABLE_AVX512}
67 +# Support for building with AVX512BF16 ISA: docker build --build-arg VLLM_CPU_AVX512BF16="true" ...
68 +ARG VLLM_CPU_AVX512BF16=0
69 +ENV VLLM_CPU_AVX512BF16=${VLLM_CPU_AVX512BF16}
70 +# Support for building with AVX512VNNI ISA: docker build --build-arg VLLM_CPU_AVX512VNNI="true" ...
71 +ARG VLLM_CPU_AVX512VNNI=0
72 +ENV VLLM_CPU_AVX512VNNI=${VLLM_CPU_AVX512VNNI}
73
74 WORKDIR /workspace/vllm
75