Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
ab66536d
Unverified
Commit
ab66536d
authored
Jun 18, 2024
by
Jie Fu (傅杰)
Committed by
GitHub
Jun 17, 2024
Browse files
[CI/BUILD] Support non-AVX512 vLLM building and testing (#5574)
parent
728c4c8a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
.buildkite/run-cpu-test.sh
.buildkite/run-cpu-test.sh
+4
-1
Dockerfile.cpu
Dockerfile.cpu
+4
-0
cmake/cpu_extension.cmake
cmake/cpu_extension.cmake
+12
-1
No files found.
.buildkite/run-cpu-test.sh
View file @
ab66536d
...
...
@@ -4,17 +4,20 @@ set -ex
# Try building the docker image
docker build
-t
cpu-test
-f
Dockerfile.cpu
.
docker build
--build-arg
VLLM_CPU_DISABLE_AVX512
=
"true"
-t
cpu-test-avx2
-f
Dockerfile.cpu
.
# Setup cleanup
remove_docker_container
()
{
docker
rm
-f
cpu-test
||
true
;
}
remove_docker_container
()
{
docker
rm
-f
cpu-test
cpu-test-avx2
||
true
;
}
trap
remove_docker_container EXIT
remove_docker_container
# Run the image
docker run
-itd
-v
~/.cache/huggingface:/root/.cache/huggingface
--cpuset-cpus
=
48-95
--cpuset-mems
=
1
--network
host
-e
HF_TOKEN
--env
VLLM_CPU_KVCACHE_SPACE
=
4
--name
cpu-test cpu-test
docker run
-itd
-v
~/.cache/huggingface:/root/.cache/huggingface
--cpuset-cpus
=
48-95
--cpuset-mems
=
1
--network
host
-e
HF_TOKEN
--env
VLLM_CPU_KVCACHE_SPACE
=
4
--name
cpu-test-avx2 cpu-test-avx2
# offline inference
docker
exec
cpu-test bash
-c
"python3 examples/offline_inference.py"
docker
exec
cpu-test-avx2 bash
-c
"python3 examples/offline_inference.py"
# Run basic model test
docker
exec
cpu-test bash
-c
"cd tests;
...
...
Dockerfile.cpu
View file @
ab66536d
...
...
@@ -21,6 +21,10 @@ WORKDIR /workspace/vllm
RUN pip install -v -r requirements-cpu.txt --extra-index-url https://download.pytorch.org/whl/cpu
# Support for building with non-AVX512 vLLM: docker build --build-arg VLLM_CPU_DISABLE_AVX512="true" ...
ARG VLLM_CPU_DISABLE_AVX512
ENV VLLM_CPU_DISABLE_AVX512=${VLLM_CPU_DISABLE_AVX512}
RUN VLLM_TARGET_DEVICE=cpu python3 setup.py install
WORKDIR /workspace/
...
...
cmake/cpu_extension.cmake
View file @
ab66536d
...
...
@@ -33,10 +33,21 @@ function (find_isa CPUINFO TARGET OUT)
endif
()
endfunction
()
function
(
is_avx512_disabled OUT
)
set
(
DISABLE_AVX512 $ENV{VLLM_CPU_DISABLE_AVX512}
)
if
(
DISABLE_AVX512 AND DISABLE_AVX512 STREQUAL
"true"
)
set
(
${
OUT
}
ON PARENT_SCOPE
)
else
()
set
(
${
OUT
}
OFF PARENT_SCOPE
)
endif
()
endfunction
()
is_avx512_disabled
(
AVX512_DISABLED
)
find_isa
(
${
CPUINFO
}
"avx2"
AVX2_FOUND
)
find_isa
(
${
CPUINFO
}
"avx512f"
AVX512_FOUND
)
if
(
AVX512_FOUND
)
if
(
AVX512_FOUND
AND NOT AVX512_DISABLED
)
list
(
APPEND CXX_COMPILE_FLAGS
"-mavx512f"
"-mavx512vl"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment