|
1 | 1 | ARG CUDA_VERSION=12.9.1 |
2 | 2 | ARG PYTHON_VERSION=3.12 |
3 | 3 |
|
4 | | -# BUILD_BASE_IMAGE: used to setup python build xformers, and vllm wheels, It can be replaced with a different base image from local machine, |
| 4 | +# BUILD_BASE_IMAGE: used to build vllm wheels, It can be replaced with a different base image from local machine, |
5 | 5 | # by default, it uses the torch-nightly-base stage from this docker image |
6 | 6 | ARG BUILD_BASE_IMAGE=torch-nightly-base |
7 | 7 | ARG FINAL_BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu22.04 |
@@ -116,28 +116,9 @@ RUN --mount=type=cache,target=/root/.cache/uv \ |
116 | 116 | RUN --mount=type=cache,target=/root/.cache/uv \ |
117 | 117 | uv pip install --system -r requirements/common.txt |
118 | 118 |
|
119 | | -ARG max_jobs=16 |
120 | | -ENV MAX_JOBS=${max_jobs} |
121 | | - |
122 | | -RUN --mount=type=cache,target=/root/.cache/uv bash - <<'BASH' |
123 | | - export TORCH_CUDA_ARCH_LIST='7.5 8.0+PTX 9.0a' |
124 | | - git clone https://github.com/facebookresearch/xformers.git |
125 | | - |
126 | | - pushd xformers |
127 | | - git checkout v0.0.33.post1 |
128 | | - git submodule update --init --recursive |
129 | | - python3 setup.py bdist_wheel --dist-dir=../xformers-dist --verbose |
130 | | - popd |
131 | | - |
132 | | - rm -rf xformers |
133 | | -BASH |
134 | | - |
135 | | -RUN --mount=type=cache,target=/root/.cache/uv \ |
136 | | - uv pip install --system xformers-dist/*.whl |
137 | | - |
138 | 119 | RUN uv pip freeze | grep -i '^torch\|^torchvision\|^torchaudio' > torch_build_versions.txt |
139 | 120 | RUN cat torch_build_versions.txt |
140 | | -RUN pip freeze | grep -E 'torch|xformers|torchvision|torchaudio' |
| 121 | +RUN pip freeze | grep -E 'torch|torchvision|torchaudio' |
141 | 122 | #################### BASE BUILD IMAGE #################### |
142 | 123 |
|
143 | 124 |
|
@@ -240,7 +221,6 @@ RUN if command -v apt-get >/dev/null; then \ |
240 | 221 |
|
241 | 222 | # Get the torch versions, and whls used in previous stage |
242 | 223 | COPY --from=base /workspace/torch_build_versions.txt ./torch_build_versions.txt |
243 | | -COPY --from=base /workspace/xformers-dist /wheels/xformers |
244 | 224 | COPY --from=build /workspace/vllm-dist /wheels/vllm |
245 | 225 | RUN echo "[INFO] Listing current directory before torch install step:" && \ |
246 | 226 | ls -al && \ |
@@ -290,20 +270,15 @@ RUN --mount=type=cache,target=/root/.cache/uv \ |
290 | 270 | RUN --mount=type=cache,target=/root/.cache/uv \ |
291 | 271 | uv pip install --system /wheels/vllm/*.whl --verbose |
292 | 272 |
|
293 | | -# Install xformers wheel from previous stage |
294 | | -RUN --mount=type=cache,target=/root/.cache/uv \ |
295 | | - uv pip install --system /wheels/xformers/*.whl --verbose |
296 | | - |
297 | 273 | # Logging to confirm the torch versions |
298 | | -RUN pip freeze | grep -E 'torch|xformers|vllm' |
299 | | -RUN uv pip freeze | grep -i '^torch\|^torchvision\|^torchaudio\|^xformers\|^vllm' > build_summary.txt |
| 274 | +RUN pip freeze | grep -E 'torch|vllm' |
| 275 | +RUN uv pip freeze | grep -i '^torch\|^torchvision\|^torchaudio\|^vllm' > build_summary.txt |
300 | 276 | ################### VLLM INSTALLED IMAGE #################### |
301 | 277 |
|
302 | 278 |
|
303 | 279 | #################### EXPORT STAGE #################### |
304 | 280 | FROM scratch as export-wheels |
305 | 281 |
|
306 | 282 | # Just copy the wheels we prepared in previous stages |
307 | | -COPY --from=base /workspace/xformers-dist /wheels/xformers |
308 | 283 | COPY --from=build /workspace/vllm-dist /wheels/vllm |
309 | 284 | COPY --from=vllm-base /workspace/build_summary.txt /wheels/build_summary.txt |
0 commit comments