Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Commit 0a5881d

Browse files
authored
Cythonize vllm build (#214)
* adding cython into docker file with flag * correcting if
1 parent a87da2b commit 0a5881d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Dockerfile.rocm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ARG BUILD_PYTORCH="1"
1212
# This ARG should also be "0" or "1". If "1", the vLLM development directory is obtained via git clone.
1313
# If "0", it is copied in from the local working directory.
1414
ARG REMOTE_VLLM="0"
15+
ARG USE_CYTHON="0"
1516

1617
# -----------------------
1718
# vLLM base image
@@ -153,6 +154,7 @@ FROM fetch_vllm_${REMOTE_VLLM} AS fetch_vllm
153154
# vLLM (and gradlib) build stages
154155
FROM fetch_vllm AS build_vllm
155156
ARG COMMON_WORKDIR
157+
ARG USE_CYTHON
156158
# Install hipblaslt
157159
RUN --mount=type=bind,from=export_hipblaslt,src=/,target=/install \
158160
if ls /install/*.deb; then \
@@ -168,7 +170,9 @@ if ls /install/*.whl; then \
168170
fi
169171
# Build vLLM
170172
RUN cd vllm \
171-
&& python3 setup.py clean --all && python3 setup.py bdist_wheel --dist-dir=dist
173+
&& python3 setup.py clean --all \
174+
&& if [ ${USE_CYTHON} -eq "1" ]; then python3 setup_cython.py build_ext --inplace; fi \
175+
&& python3 setup.py bdist_wheel --dist-dir=dist
172176
# Build gradlib
173177
RUN cd vllm/gradlib \
174178
&& python3 setup.py clean --all && python3 setup.py bdist_wheel --dist-dir=dist

0 commit comments

Comments
 (0)