1+ # Build seq: rocm_base => build_base => build_triton => build_fa => build_vllm => final
2+
13ARG BASE_PYTORCH_IMAGE="docker.io/mixa3607/pytorch-gfx906:v2.10.0-rocm-6.3.3"
4+ ARG MAX_JOBS=""
25
36ARG VLLM_REPO="https://github.com/ai-infos/vllm-gfx906-mobydick.git"
47ARG VLLM_BRANCH="main"
@@ -33,7 +36,7 @@ RUN pip3 install \
3336 'packaging>=24.2' \
3437 'jinja2>=3.1.6' \
3538 'timm>=1.0.17' \
36- '/opt/share/amd_smi'
39+ '/opt/rocm/ share/amd_smi'
3740RUN apt install curl wget jq aria2 -y
3841
3942# ############ Build base #############
@@ -48,6 +51,8 @@ RUN pip3 install \
4851
4952# ############ Build triton #############
5053FROM build_base AS build_triton
54+ RUN --mount=type=bind,from=build_base,src=/tmp,target=/force-sequental-build echo ''
55+
5156ARG TRITON_REPO
5257ARG TRITON_BRANCH
5358ARG TRITON_COMMIT
@@ -60,11 +65,15 @@ RUN if [ "$TRITON_COMMIT" != "" ]; then git checkout "$TRITON_COMMIT"; fi
6065COPY ./patch/${TRITON_PATCH} ./${TRITON_PATCH}
6166RUN git apply ./${TRITON_PATCH} --allow-empty
6267# Build
63- RUN python3 setup.py bdist_wheel --dist-dir=/dist
68+ ARG MAX_JOBS
69+ RUN MAX_JOBS=${MAX_JOBS:-$(nproc)} \
70+ python3 setup.py bdist_wheel --dist-dir=/dist
6471RUN ls /dist
6572
6673# ############ Build FA #############
6774FROM build_base AS build_fa
75+ RUN --mount=type=bind,from=build_triton,src=/tmp,target=/force-sequental-build echo ''
76+
6877ARG FA_REPO
6978ARG FA_BRANCH
7079ARG FA_COMMIT
@@ -77,11 +86,15 @@ RUN if [ "$FA_COMMIT" != "" ]; then git checkout "$FA_COMMIT"; fi
7786COPY ./patch/${FA_PATCH} ./${FA_PATCH}
7887RUN git apply ./${FA_PATCH} --allow-empty
7988# Build
80- RUN python3 setup.py bdist_wheel --dist-dir=/dist
89+ ARG MAX_JOBS
90+ RUN MAX_JOBS=${MAX_JOBS:-$(nproc)} \
91+ python3 setup.py bdist_wheel --dist-dir=/dist
8192RUN ls /dist
8293
8394# ############ Build vllm #############
8495FROM build_base AS build_vllm
96+ RUN --mount=type=bind,from=build_fa,src=/tmp,target=/force-sequental-build echo ''
97+
8598ARG VLLM_REPO
8699ARG VLLM_BRANCH
87100ARG VLLM_COMMIT
@@ -95,7 +108,9 @@ COPY ./patch/${VLLM_PATCH} ./${VLLM_PATCH}
95108RUN git apply ./${VLLM_PATCH} --allow-empty
96109# Build
97110RUN pip install -r requirements/rocm.txt
98- RUN python3 setup.py bdist_wheel --dist-dir=/dist
111+ ARG MAX_JOBS
112+ RUN MAX_JOBS=${MAX_JOBS:-$(nproc)} \
113+ python3 setup.py bdist_wheel --dist-dir=/dist
99114RUN ls /dist
100115
101116# ############ Install all #############
0 commit comments