Skip to content

Commit 08808b4

Browse files
committed
Adjust dockerfile to ROCm7 build
Signed-off-by: Gregory Shtrasberg <Gregory.Shtrasberg@amd.com>
1 parent d6a518f commit 08808b4

File tree

2 files changed

+18
-51
lines changed

2 files changed

+18
-51
lines changed

docker/Dockerfile.rocm

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# default base image
22
ARG REMOTE_VLLM="0"
33
ARG COMMON_WORKDIR=/app
4-
ARG BASE_IMAGE=rocm/vllm-dev:base
4+
ARG BASE_IMAGE=rocm/vllm-dev:base_rocm7_build38
55

66
FROM ${BASE_IMAGE} AS base
77

@@ -29,7 +29,11 @@ ARG VLLM_BRANCH="main"
2929
ONBUILD RUN git clone ${VLLM_REPO} \
3030
&& cd vllm \
3131
&& git fetch -v --prune -- origin ${VLLM_BRANCH} \
32-
&& git checkout FETCH_HEAD
32+
&& git checkout FETCH_HEAD \
33+
&& if [[ ${VLLM_REPO} != "https://github.com/vllm-project/vllm.git" ]] ; then \
34+
git remote add upstream "https://github.com/vllm-project/vllm.git" \
35+
&& git fetch upstream \
36+
fi
3337
FROM fetch_vllm_${REMOTE_VLLM} AS fetch_vllm
3438

3539
# -----------------------

docker/Dockerfile.rocm_base

Lines changed: 12 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
1-
ARG BASE_IMAGE=rocm/dev-ubuntu-22.04:6.4.1-complete
2-
ARG HIPBLASLT_BRANCH="aa0bda7b"
3-
ARG HIPBLAS_COMMON_BRANCH="9b80ba8e"
4-
ARG LEGACY_HIPBLASLT_OPTION=
5-
ARG TRITON_BRANCH="e5be006"
6-
ARG TRITON_REPO="https://github.com/triton-lang/triton.git"
7-
ARG PYTORCH_BRANCH="f717b2af"
8-
ARG PYTORCH_VISION_BRANCH="v0.21.0"
1+
ARG BASE_IMAGE=rocm/dev-ubuntu-22.04:7.0-complete
2+
ARG TRITON_BRANCH="f9e5bf54"
3+
ARG TRITON_REPO="https://github.com/ROCm/triton.git"
4+
ARG PYTORCH_BRANCH="b2fb6885"
5+
ARG PYTORCH_VISION_BRANCH="v0.23.0"
96
ARG PYTORCH_REPO="https://github.com/ROCm/pytorch.git"
107
ARG PYTORCH_VISION_REPO="https://github.com/pytorch/vision.git"
11-
ARG FA_BRANCH="1a7f4dfa"
8+
ARG FA_BRANCH="0e60e394"
129
ARG FA_REPO="https://github.com/Dao-AILab/flash-attention.git"
13-
ARG AITER_BRANCH="4822e675"
10+
ARG AITER_BRANCH="2ab9f4cd"
1411
ARG AITER_REPO="https://github.com/ROCm/aiter.git"
1512

1613
FROM ${BASE_IMAGE} AS base
1714

18-
ENV PATH=/opt/rocm/llvm/bin:$PATH
15+
ENV PATH=/opt/rocm/llvm/bin:/opt/rocm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
1916
ENV ROCM_PATH=/opt/rocm
2017
ENV LD_LIBRARY_PATH=/opt/rocm/lib:/usr/local/lib:
21-
ARG PYTORCH_ROCM_ARCH=gfx90a;gfx942;gfx1100;gfx1101;gfx1200;gfx1201
18+
ARG PYTORCH_ROCM_ARCH=gfx90a;gfx942;gfx950;gfx1100;gfx1101;gfx1200;gfx1201
2219
ENV PYTORCH_ROCM_ARCH=${PYTORCH_ROCM_ARCH}
20+
ENV AITER_ROCM_ARCH=gfx942;gfx950
2321

2422
ARG PYTHON_VERSION=3.12
2523

@@ -45,29 +43,6 @@ RUN apt-get update -y \
4543

4644
RUN pip install -U packaging 'cmake<4' ninja wheel 'setuptools<80' pybind11 Cython
4745

48-
FROM base AS build_hipblaslt
49-
ARG HIPBLASLT_BRANCH
50-
ARG HIPBLAS_COMMON_BRANCH
51-
# Set to "--legacy_hipblas_direct" for ROCm<=6.2
52-
ARG LEGACY_HIPBLASLT_OPTION
53-
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
55-
RUN cd hipBLAS-common \
56-
&& git checkout ${HIPBLAS_COMMON_BRANCH} \
57-
&& mkdir build \
58-
&& cd build \
59-
&& cmake .. \
60-
&& make package \
61-
&& dpkg -i ./*.deb
62-
RUN git clone https://github.com/ROCm/hipBLASLt
63-
RUN cd hipBLASLt \
64-
&& git checkout ${HIPBLASLT_BRANCH} \
65-
&& apt-get install -y llvm-dev \
66-
&& ./install.sh -dc --architecture ${PYTORCH_ROCM_ARCH} ${LEGACY_HIPBLASLT_OPTION} \
67-
&& cd build/release \
68-
&& make package
69-
RUN mkdir -p /app/install && cp /app/hipBLASLt/build/release/*.deb /app/hipBLAS-common/build/*.deb /app/install
70-
7146
FROM base AS build_triton
7247
ARG TRITON_BRANCH
7348
ARG TRITON_REPO
@@ -121,13 +96,11 @@ RUN cd aiter \
12196
&& git checkout ${AITER_BRANCH} \
12297
&& git submodule update --init --recursive \
12398
&& pip install -r requirements.txt
124-
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
99+
RUN pip install pyyaml && cd aiter && PREBUILD_KERNELS=1 GPU_ARCHS=${AITER_ROCM_ARCH} python3 setup.py bdist_wheel --dist-dir=dist && ls /app/aiter/dist/*.whl
125100
RUN mkdir -p /app/install && cp /app/aiter/dist/*.whl /app/install
126101

127102
FROM base AS debs
128103
RUN mkdir /app/debs
129-
RUN --mount=type=bind,from=build_hipblaslt,src=/app/install/,target=/install \
130-
cp /install/*.deb /app/debs
131104
RUN --mount=type=bind,from=build_triton,src=/app/install/,target=/install \
132105
cp /install/*.whl /app/debs
133106
RUN --mount=type=bind,from=build_amdsmi,src=/app/install/,target=/install \
@@ -138,11 +111,6 @@ RUN --mount=type=bind,from=build_aiter,src=/app/install/,target=/install \
138111
cp /install/*.whl /app/debs
139112

140113
FROM base AS final
141-
RUN --mount=type=bind,from=build_hipblaslt,src=/app/install/,target=/install \
142-
dpkg -i /install/*deb \
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
146114
RUN --mount=type=bind,from=build_triton,src=/app/install/,target=/install \
147115
pip install /install/*.whl
148116
RUN --mount=type=bind,from=build_amdsmi,src=/app/install/,target=/install \
@@ -153,9 +121,6 @@ RUN --mount=type=bind,from=build_aiter,src=/app/install/,target=/install \
153121
pip install /install/*.whl
154122

155123
ARG BASE_IMAGE
156-
ARG HIPBLAS_COMMON_BRANCH
157-
ARG HIPBLASLT_BRANCH
158-
ARG LEGACY_HIPBLASLT_OPTION
159124
ARG TRITON_BRANCH
160125
ARG TRITON_REPO
161126
ARG PYTORCH_BRANCH
@@ -167,15 +132,13 @@ ARG FA_REPO
167132
ARG AITER_BRANCH
168133
ARG AITER_REPO
169134
RUN echo "BASE_IMAGE: ${BASE_IMAGE}" > /app/versions.txt \
170-
&& echo "HIPBLAS_COMMON_BRANCH: ${HIPBLAS_COMMON_BRANCH}" >> /app/versions.txt \
171-
&& echo "HIPBLASLT_BRANCH: ${HIPBLASLT_BRANCH}" >> /app/versions.txt \
172-
&& echo "LEGACY_HIPBLASLT_OPTION: ${LEGACY_HIPBLASLT_OPTION}" >> /app/versions.txt \
173135
&& echo "TRITON_BRANCH: ${TRITON_BRANCH}" >> /app/versions.txt \
174136
&& echo "TRITON_REPO: ${TRITON_REPO}" >> /app/versions.txt \
175137
&& echo "PYTORCH_BRANCH: ${PYTORCH_BRANCH}" >> /app/versions.txt \
176138
&& echo "PYTORCH_VISION_BRANCH: ${PYTORCH_VISION_BRANCH}" >> /app/versions.txt \
177139
&& echo "PYTORCH_REPO: ${PYTORCH_REPO}" >> /app/versions.txt \
178140
&& echo "PYTORCH_VISION_REPO: ${PYTORCH_VISION_REPO}" >> /app/versions.txt \
179141
&& echo "FA_BRANCH: ${FA_BRANCH}" >> /app/versions.txt \
142+
&& echo "FA_REPO: ${FA_REPO}" >> /app/versions.txt \
180143
&& echo "AITER_BRANCH: ${AITER_BRANCH}" >> /app/versions.txt \
181144
&& echo "AITER_REPO: ${AITER_REPO}" >> /app/versions.txt

0 commit comments

Comments
 (0)