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 "
44ARG LEGACY_HIPBLASLT_OPTION=
5- ARG RCCL_BRANCH="648a58d"
6- ARG RCCL_REPO="https://github.com/ROCm/rccl"
75ARG TRITON_BRANCH="e5be006"
86ARG TRITON_REPO="https://github.com/triton-lang/triton.git"
9- ARG PYTORCH_BRANCH="295f2ed4 "
7+ ARG PYTORCH_BRANCH="f717b2af "
108ARG 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"
1210ARG PYTORCH_VISION_REPO="https://github.com/pytorch/vision.git"
1311ARG FA_BRANCH="1a7f4dfa"
1412ARG FA_REPO="https://github.com/Dao-AILab/flash-attention.git"
15- ARG AITER_BRANCH="916bf3c "
13+ ARG AITER_BRANCH="4822e675 "
1614ARG AITER_REPO="https://github.com/ROCm/aiter.git"
1715
1816FROM ${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
5048FROM base AS build_hipblaslt
5149ARG HIPBLASLT_BRANCH
5250ARG HIPBLAS_COMMON_BRANCH
5351# Set to "--legacy_hipblas_direct" for ROCm<=6.2
5452ARG LEGACY_HIPBLASLT_OPTION
5553RUN git clone https://github.com/ROCm/hipBLAS-common.git
54+ RUN apt-get remove -y hipblaslt && apt-get autoremove -y && apt-get autoclean -y
5655RUN cd hipBLAS-common \
5756 && git checkout ${HIPBLAS_COMMON_BRANCH} \
5857 && mkdir build \
@@ -69,24 +68,17 @@ RUN cd hipBLASLt \
6968 && make package
7069RUN 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-
8171FROM base AS build_triton
8272ARG TRITON_BRANCH
8373ARG TRITON_REPO
8474RUN git clone ${TRITON_REPO}
8575RUN 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
9183FROM base AS build_amdsmi
9284RUN cd /opt/rocm/share/amd_smi \
@@ -132,15 +124,25 @@ RUN cd aiter \
132124RUN pip install pyyaml && cd aiter && PREBUILD_KERNELS=1 GPU_ARCHS=gfx942 python3 setup.py bdist_wheel --dist-dir=dist && ls /app/aiter/dist/*.whl
133125RUN 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+
135140FROM base AS final
136141RUN --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
144146RUN --mount=type=bind,from=build_triton,src=/app/install/,target=/install \
145147 pip install /install/*.whl
146148RUN --mount=type=bind,from=build_amdsmi,src=/app/install/,target=/install \
@@ -154,8 +156,6 @@ ARG BASE_IMAGE
154156ARG HIPBLAS_COMMON_BRANCH
155157ARG HIPBLASLT_BRANCH
156158ARG LEGACY_HIPBLASLT_OPTION
157- ARG RCCL_BRANCH
158- ARG RCCL_REPO
159159ARG TRITON_BRANCH
160160ARG TRITON_REPO
161161ARG 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