Skip to content

Commit d11132b

Browse files
authored
updating vllm modules to have upstream triton attention (#17)
Updating to be able to use vllm-project/vllm#14071. --------- Signed-off-by: Burkhard Ringlein <ngl@zurich.ibm.com>
1 parent 8ac1aca commit d11132b

File tree

5 files changed

+35
-23
lines changed

5 files changed

+35
-23
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
ARG BASE_UBI_IMAGE_TAG=9.4
33
ARG PYTHON_VERSION=3.12
44
ARG MAX_JOBS=64
5-
ARG PIP_VLLM_VERSION=0.7.3
5+
ARG PIP_VLLM_VERSION=0.8.1
66

77
ARG VLLM_SOURCE=pip
88
# or VLLM_SOURCE=custom
@@ -55,7 +55,7 @@ ENV CUDA_HOME="/usr/local/cuda" \
5555
# install build dependencies
5656
RUN --mount=type=cache,target=/root/.cache/pip \
5757
--mount=type=cache,target=/root/.cache/uv \
58-
--mount=type=bind,source=vllm/requirements-build.txt,target=requirements-build.txt \
58+
--mount=type=bind,source=vllm/requirements/build.txt,target=requirements-build.txt \
5959
uv pip install -r requirements-build.txt
6060

6161
# set env variables for build
@@ -154,6 +154,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \
154154
uv pip install vllm-*.whl
155155

156156
# copy python stuff of vllm
157+
ARG VLLM_SOURCE
157158
RUN mkdir -p /workspace/vllm
158159
COPY vllm/vllm /workspace/vllm
159160
RUN if [ "$VLLM_SOURCE" = "custom" ] ; then cp -r /workspace/vllm/* ${VIRTUAL_ENV}/lib/python${PYTHON_VERSION}/site-packages/vllm/ \

Dockerfile.rocm

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ ARG PYTORCH_VISION_REPO="https://github.com/pytorch/vision.git"
1414
ARG FA_BRANCH="1a7f4dfa"
1515
ARG FA_REPO="https://github.com/Dao-AILab/flash-attention.git"
1616

17+
# if not using the submodule
1718
ARG VLLM_BRANCH="v0.7.3+rocm"
18-
ARG VLLM_VERSION=0.7.3
19+
20+
ARG VLLM_VERSION=0.8.1
1921
ARG PYTORCH_ROCM_ARCH=gfx90a;gfx942
2022
ARG VLLM_SOURCE=submodule
2123
# or ARG VLLM_SOURCE=upstream
@@ -158,12 +160,17 @@ RUN cd pytorch && git checkout ${PYTORCH_BRANCH} && \
158160
&& python3 tools/amd_build/build_amd.py \
159161
&& CMAKE_PREFIX_PATH=$(python3 -c 'import sys; print(sys.prefix)') python3 setup.py bdist_wheel --dist-dir=dist \
160162
&& pip install dist/*.whl
161-
RUN git clone ${PYTORCH_VISION_REPO} vision
162-
RUN cd vision && git checkout ${PYTORCH_VISION_BRANCH} \
163-
&& python3 setup.py bdist_wheel --dist-dir=dist \
164-
&& pip install dist/*.whl
165-
RUN mkdir -p /workspace/install && cp /workspace/pytorch/dist/*.whl /workspace/install \
166-
&& cp /workspace/vision/dist/*.whl /workspace/install
163+
# RUN git clone ${PYTORCH_VISION_REPO} vision
164+
# RUN cd vision && git checkout ${PYTORCH_VISION_BRANCH} \
165+
# && python3 setup.py bdist_wheel --dist-dir=dist \
166+
# && pip install dist/*.whl
167+
# WORKDIR /workspace/vision/dist
168+
# RUN --mount=type=cache,target=/root/.cache/pip \
169+
# pip download torchvision==${PYTORCH_VISION_BRANCH} --no-deps
170+
171+
RUN mkdir -p /workspace/install && cp /workspace/pytorch/dist/*.whl /workspace/install
172+
# \
173+
# && cp /workspace/vision/dist/*.whl /workspace/install
167174

168175

169176
## vLLM Builder #################################################################
@@ -242,7 +249,7 @@ ENV PYTORCH_ROCM_ARCH=${PYTORCH_ROCM_ARCH}
242249

243250
# Build vLLM
244251
RUN cd vllm \
245-
&& python3 -m pip install -r requirements-rocm.txt
252+
&& python3 -m pip install -r requirements/rocm.txt
246253

247254
ENV CMAKE_PREFIX_PATH="/opt/rocm/;/opt/rocm/hip;$(python3 -c 'import sys; print(sys.prefix)')"
248255
RUN cd vllm \
@@ -332,9 +339,13 @@ WORKDIR /workspace
332339
#ENV PYTORCH_ROCM_ARCH="gfx90a;gfx942"
333340
ARG PYTORCH_ROCM_ARCH
334341
ENV PYTORCH_ROCM_ARCH=${PYTORCH_ROCM_ARCH}
335-
COPY rocm_vllm/requirements-*.txt /workspace/
336-
RUN python3 -m pip install -r requirements-rocm.txt \
337-
&& pip uninstall -y vllm
342+
COPY rocm_vllm/requirements/*.txt /workspace/
343+
RUN --mount=type=cache,target=/root/.cache/pip \
344+
--mount=type=cache,target=/root/.cache/uv \
345+
uv pip install -r rocm.txt \
346+
&& pip uninstall -y vllm \
347+
# FIXME: remove once rocm requirements are updated again
348+
&& uv pip install cachetools
338349
# export PYTORCH_ROCM_ARCH=${PYTORCH_ROCM_ARCH} \
339350

340351
# Install vllm
@@ -361,12 +372,14 @@ RUN --mount=type=cache,target=/root/.cache/pip \
361372
uv pip install /workspace/fa-install/*.whl
362373

363374
# Install pytorch
375+
# ARG ROCM_VERSION
364376
RUN mkdir -p /workspace/torch-install
365377
COPY --from=pytorch-builder /workspace/install/*.whl /workspace/torch-install
366378
RUN ls -al /workspace/torch-install/
367379
RUN --mount=type=cache,target=/root/.cache/pip \
368380
--mount=type=cache,target=/root/.cache/uv \
369-
uv pip install /workspace/torch-install/*.whl
381+
uv pip install /workspace/torch-install/*.whl && \
382+
uv pip install torchvision --no-deps --index-url https://download.pytorch.org/whl/rocm6.2.4
370383
# install rocm pytorch
371384
# RUN --mount=type=cache,target=/root/.cache/pip \
372385
# --mount=type=cache,target=/root/.cache/uv \
@@ -387,7 +400,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \
387400
# ENV LD_LIBRARY_PATH="${VIRTUAL_ENV}/lib/python${PYTHON_VERSION}/site-packages/nvidia/cuda_cupti/lib:${LD_LIBRARY_PATH}"
388401

389402

390-
# copy requirements before to avoid reinstall
403+
# copy requirements explicitly before to avoid reinstall
391404
COPY triton-dejavu/requirements-opt.txt dejavu-requirements-opt.txt
392405
RUN --mount=type=cache,target=/root/.cache/pip \
393406
--mount=type=cache,target=/root/.cache/uv \
@@ -418,16 +431,14 @@ RUN --mount=type=cache,target=/root/.cache/pip \
418431
--mount=type=cache,target=/root/.cache/uv \
419432
uv pip install pytest llnl-hatchet debugpy
420433

421-
422-
423434
# install lm_eval
424435
RUN --mount=type=cache,target=/root/.cache/pip \
425436
--mount=type=cache,target=/root/.cache/uv \
426437
git clone --depth 1 https://github.com/EleutherAI/lm-evaluation-harness && cd lm-evaluation-harness && uv pip install .
427438

428439
# copy vllm benchmarks and download share GPT
429440
COPY vllm/benchmarks benchmarks
430-
RUN wget https://huggingface.co/datasets/anon8231489123/ShareGPT_Vicuna_unfiltered/resolve/main/ShareGPT_V3_unfiltered_cleaned_split.json
441+
COPY ShareGPT_V3_unfiltered_cleaned_split.json ShareGPT_V3_unfiltered_cleaned_split.json
431442

432443
ENV STORE_TEST_RESULT_PATH=/results
433444

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ build: Dockerfile ShareGPT_V3_unfiltered_cleaned_split.json
2323
docker build --progress=plain --build-arg MAX_JOBS=$(MAX_JOBS) . -t ${TAG}
2424
@echo "Built docker image with tag: ${TAG}"
2525

26-
rocm-vllm-all.tar: .git/modules/rocm_vllm/index
26+
rocm-vllm-all.tar: .git/modules/rocm_vllm/index
2727
cd rocm_vllm; ls -A | xargs tar --mtime='1970-01-01' -cf ../rocm-vllm-all.tar
2828

29-
rocm: Dockerfile.rocm rocm-vllm-all.tar all-git.tar
29+
rocm: Dockerfile.rocm rocm-vllm-all.tar all-git.tar ShareGPT_V3_unfiltered_cleaned_split.json
3030
docker build --progress=plain --build-arg MAX_JOBS=$(MAX_JOBS) --build-arg VLLM_SOURCE=submodule . -t ${TAG} -f Dockerfile.rocm
3131
@echo "Built docker image with tag: ${TAG}"
3232

33-
rocm-upstream: Dockerfile.rocm
33+
rocm-upstream: Dockerfile.rocm ShareGPT_V3_unfiltered_cleaned_split.json
3434
@echo "using https://github.com/ROCm/vllm repository; vllm submodule CURRENTLY IGNORED"
3535
docker build --progress=plain --build-arg MAX_JOBS=$(MAX_JOBS) --build-arg VLLM_SOURCE=upsteram . -t ${TAG} -f Dockerfile.rocm
3636
@echo "Built docker image with tag: ${TAG}"

rocm_vllm

Submodule rocm_vllm updated 471 files

vllm

Submodule vllm updated 829 files

0 commit comments

Comments
 (0)