Skip to content

Commit b9a1c4c

Browse files
authored
[ROCm][CI/Build] Sync ROCm dockerfiles with the ROCm fork (vllm-project#24279)
Signed-off-by: Gregory Shtrasberg <[email protected]>
1 parent 1aa427f commit b9a1c4c

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

docker/Dockerfile.rocm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/requirements /requirements
4747
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/benchmarks /benchmarks
4848
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/tests /tests
4949
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/examples /examples
50+
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/docker/Dockerfile.rocm /docker/
5051
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/.buildkite /.buildkite
5152

5253
# -----------------------
@@ -71,7 +72,7 @@ COPY --from=build_vllm ${COMMON_WORKDIR}/vllm /vllm-workspace
7172
RUN cd /vllm-workspace \
7273
&& rm -rf vllm \
7374
&& python3 -m pip install -e tests/vllm_test_utils \
74-
&& python3 -m pip install git+https://github.com/EleutherAI/lm-evaluation-harness.git@206b7722158f58c35b7ffcd53b035fdbdda5126d#egg=lm-eval[api] \
75+
&& python3 -m pip install lm-eval[api]==0.4.4 \
7576
&& python3 -m pip install pytest-shard
7677

7778
# -----------------------
@@ -100,6 +101,7 @@ ARG COMMON_WORKDIR
100101
# Copy over the benchmark scripts as well
101102
COPY --from=export_vllm /benchmarks ${COMMON_WORKDIR}/vllm/benchmarks
102103
COPY --from=export_vllm /examples ${COMMON_WORKDIR}/vllm/examples
104+
COPY --from=export_vllm /docker ${COMMON_WORKDIR}/vllm/docker
103105

104106
ENV RAY_EXPERIMENTAL_NOSET_ROCR_VISIBLE_DEVICES=1
105107
ENV TOKENIZERS_PARALLELISM=false

docker/Dockerfile.rocm_base

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
ARG BASE_IMAGE=rocm/dev-ubuntu-22.04:6.3.1-complete
2-
ARG HIPBLASLT_BRANCH="db8e93b4"
3-
ARG HIPBLAS_COMMON_BRANCH="7c1566b"
1+
ARG BASE_IMAGE=rocm/dev-ubuntu-22.04:6.4.1-complete
2+
ARG HIPBLASLT_BRANCH="aa0bda7b"
3+
ARG HIPBLAS_COMMON_BRANCH="9b80ba8e"
44
ARG LEGACY_HIPBLASLT_OPTION=
5-
ARG RCCL_BRANCH="648a58d"
6-
ARG RCCL_REPO="https://github.com/ROCm/rccl"
75
ARG TRITON_BRANCH="e5be006"
86
ARG TRITON_REPO="https://github.com/triton-lang/triton.git"
9-
ARG PYTORCH_BRANCH="295f2ed4"
7+
ARG PYTORCH_BRANCH="f717b2af"
108
ARG PYTORCH_VISION_BRANCH="v0.21.0"
11-
ARG PYTORCH_REPO="https://github.com/pytorch/pytorch.git"
9+
ARG PYTORCH_REPO="https://github.com/ROCm/pytorch.git"
1210
ARG PYTORCH_VISION_REPO="https://github.com/pytorch/vision.git"
1311
ARG FA_BRANCH="1a7f4dfa"
1412
ARG FA_REPO="https://github.com/Dao-AILab/flash-attention.git"
15-
ARG AITER_BRANCH="916bf3c"
13+
ARG AITER_BRANCH="4822e675"
1614
ARG AITER_REPO="https://github.com/ROCm/aiter.git"
1715

1816
FROM ${BASE_IMAGE} AS base
@@ -45,14 +43,15 @@ RUN apt-get update -y \
4543
&& curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} \
4644
&& python3 --version && python3 -m pip --version
4745

48-
RUN pip install -U packaging 'cmake<4' ninja wheel setuptools pybind11 Cython
46+
RUN pip install -U packaging 'cmake<4' ninja wheel 'setuptools<80' pybind11 Cython
4947

5048
FROM base AS build_hipblaslt
5149
ARG HIPBLASLT_BRANCH
5250
ARG HIPBLAS_COMMON_BRANCH
5351
# Set to "--legacy_hipblas_direct" for ROCm<=6.2
5452
ARG LEGACY_HIPBLASLT_OPTION
5553
RUN git clone https://github.com/ROCm/hipBLAS-common.git
54+
RUN apt-get remove -y hipblaslt && apt-get autoremove -y && apt-get autoclean -y
5655
RUN cd hipBLAS-common \
5756
&& git checkout ${HIPBLAS_COMMON_BRANCH} \
5857
&& mkdir build \
@@ -69,24 +68,17 @@ RUN cd hipBLASLt \
6968
&& make package
7069
RUN mkdir -p /app/install && cp /app/hipBLASLt/build/release/*.deb /app/hipBLAS-common/build/*.deb /app/install
7170

72-
FROM base AS build_rccl
73-
ARG RCCL_BRANCH
74-
ARG RCCL_REPO
75-
RUN git clone ${RCCL_REPO}
76-
RUN cd rccl \
77-
&& git checkout ${RCCL_BRANCH} \
78-
&& ./install.sh -p --amdgpu_targets ${PYTORCH_ROCM_ARCH}
79-
RUN mkdir -p /app/install && cp /app/rccl/build/release/*.deb /app/install
80-
8171
FROM base AS build_triton
8272
ARG TRITON_BRANCH
8373
ARG TRITON_REPO
8474
RUN git clone ${TRITON_REPO}
8575
RUN cd triton \
8676
&& git checkout ${TRITON_BRANCH} \
87-
&& cd python \
88-
&& python3 setup.py bdist_wheel --dist-dir=dist
89-
RUN mkdir -p /app/install && cp /app/triton/python/dist/*.whl /app/install
77+
&& if [ ! -f setup.py ]; then cd python; fi \
78+
&& python3 setup.py bdist_wheel --dist-dir=dist \
79+
&& mkdir -p /app/install && cp dist/*.whl /app/install
80+
RUN if [ -d triton/python/triton_kernels ]; then pip install build && cd triton/python/triton_kernels \
81+
&& python3 -m build --wheel && cp dist/*.whl /app/install; fi
9082

9183
FROM base AS build_amdsmi
9284
RUN cd /opt/rocm/share/amd_smi \
@@ -132,15 +124,25 @@ RUN cd aiter \
132124
RUN pip install pyyaml && cd aiter && PREBUILD_KERNELS=1 GPU_ARCHS=gfx942 python3 setup.py bdist_wheel --dist-dir=dist && ls /app/aiter/dist/*.whl
133125
RUN mkdir -p /app/install && cp /app/aiter/dist/*.whl /app/install
134126

127+
FROM base AS debs
128+
RUN mkdir /app/debs
129+
RUN --mount=type=bind,from=build_hipblaslt,src=/app/install/,target=/install \
130+
cp /install/*.deb /app/debs
131+
RUN --mount=type=bind,from=build_triton,src=/app/install/,target=/install \
132+
cp /install/*.whl /app/debs
133+
RUN --mount=type=bind,from=build_amdsmi,src=/app/install/,target=/install \
134+
cp /install/*.whl /app/debs
135+
RUN --mount=type=bind,from=build_pytorch,src=/app/install/,target=/install \
136+
cp /install/*.whl /app/debs
137+
RUN --mount=type=bind,from=build_aiter,src=/app/install/,target=/install \
138+
cp /install/*.whl /app/debs
139+
135140
FROM base AS final
136141
RUN --mount=type=bind,from=build_hipblaslt,src=/app/install/,target=/install \
137142
dpkg -i /install/*deb \
138-
&& sed -i 's/, hipblaslt-dev \(.*\), hipcub-dev/, hipcub-dev/g' /var/lib/dpkg/status \
139-
&& sed -i 's/, hipblaslt \(.*\), hipfft/, hipfft/g' /var/lib/dpkg/status
140-
RUN --mount=type=bind,from=build_rccl,src=/app/install/,target=/install \
141-
dpkg -i /install/*deb \
142-
&& sed -i 's/, rccl-dev \(.*\), rocalution/, rocalution/g' /var/lib/dpkg/status \
143-
&& sed -i 's/, rccl \(.*\), rocalution/, rocalution/g' /var/lib/dpkg/status
143+
&& perl -p -i -e 's/, hipblas-common-dev \([^)]*?\), /, /g' /var/lib/dpkg/status \
144+
&& perl -p -i -e 's/, hipblaslt-dev \([^)]*?\), /, /g' /var/lib/dpkg/status \
145+
&& perl -p -i -e 's/, hipblaslt \([^)]*?\), /, /g' /var/lib/dpkg/status
144146
RUN --mount=type=bind,from=build_triton,src=/app/install/,target=/install \
145147
pip install /install/*.whl
146148
RUN --mount=type=bind,from=build_amdsmi,src=/app/install/,target=/install \
@@ -154,8 +156,6 @@ ARG BASE_IMAGE
154156
ARG HIPBLAS_COMMON_BRANCH
155157
ARG HIPBLASLT_BRANCH
156158
ARG LEGACY_HIPBLASLT_OPTION
157-
ARG RCCL_BRANCH
158-
ARG RCCL_REPO
159159
ARG TRITON_BRANCH
160160
ARG TRITON_REPO
161161
ARG PYTORCH_BRANCH
@@ -170,8 +170,6 @@ RUN echo "BASE_IMAGE: ${BASE_IMAGE}" > /app/versions.txt \
170170
&& echo "HIPBLAS_COMMON_BRANCH: ${HIPBLAS_COMMON_BRANCH}" >> /app/versions.txt \
171171
&& echo "HIPBLASLT_BRANCH: ${HIPBLASLT_BRANCH}" >> /app/versions.txt \
172172
&& echo "LEGACY_HIPBLASLT_OPTION: ${LEGACY_HIPBLASLT_OPTION}" >> /app/versions.txt \
173-
&& echo "RCCL_BRANCH: ${RCCL_BRANCH}" >> /app/versions.txt \
174-
&& echo "RCCL_REPO: ${RCCL_REPO}" >> /app/versions.txt \
175173
&& echo "TRITON_BRANCH: ${TRITON_BRANCH}" >> /app/versions.txt \
176174
&& echo "TRITON_REPO: ${TRITON_REPO}" >> /app/versions.txt \
177175
&& echo "PYTORCH_BRANCH: ${PYTORCH_BRANCH}" >> /app/versions.txt \
@@ -180,4 +178,4 @@ RUN echo "BASE_IMAGE: ${BASE_IMAGE}" > /app/versions.txt \
180178
&& echo "PYTORCH_VISION_REPO: ${PYTORCH_VISION_REPO}" >> /app/versions.txt \
181179
&& echo "FA_BRANCH: ${FA_BRANCH}" >> /app/versions.txt \
182180
&& echo "AITER_BRANCH: ${AITER_BRANCH}" >> /app/versions.txt \
183-
&& echo "AITER_REPO: ${AITER_REPO}" >> /app/versions.txt
181+
&& echo "AITER_REPO: ${AITER_REPO}" >> /app/versions.txt

0 commit comments

Comments
 (0)