[Docker] Remove unused Dockerfile.nightly_torch (#47338)

Co-authored-by: Andrey Talman <atalman@users.noreply.github.com>

Andrey Talman committed Jul 1, 2026 at 19:19 UTC e196268bade5291c3fd80906bf9cd8c64851b21b
1 file changed -326
docker/Dockerfile.nightly_torch deleted
-326
@@ -1,326 +0,0 @@
1 -#######
2 -#
3 -# THIS FILE IS DEPRECATED AND WILL BE REMOVED SHORTLY
4 -#
5 -# Please use the standard Dockerfile with PYTORCH_NIGHTLY=1 instead
6 -#
7 -#######
8 -
9 -# The vLLM Dockerfile is used to construct vLLM image against torch nightly that can be directly used for testing
10 -
11 -# for torch nightly, cuda >=12.6 is required,
12 -# use 12.8 due to FlashAttention issue with cuda 12.6 (https://github.com/vllm-project/vllm/issues/15435#issuecomment-2775924628)
13 -ARG CUDA_VERSION=12.8.0
14 -#
15 -#################### BASE BUILD IMAGE ####################
16 -# prepare basic build environment
17 -FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu22.04 AS base
18 -ARG CUDA_VERSION=12.8.0
19 -ARG PYTHON_VERSION=3.12
20 -ARG TARGETPLATFORM
21 -ENV DEBIAN_FRONTEND=noninteractive
22 -# Install Python and other dependencies
23 -RUN apt-get update -y \
24 - && apt-get install -y ccache software-properties-common git curl sudo \
25 - && for i in 1 2 3; do \
26 - add-apt-repository -y ppa:deadsnakes/ppa && break || \
27 - { echo "Attempt $i failed, retrying in 5s..."; sleep 5; }; \
28 - done \
29 - && apt-get update -y \
30 - && apt-get install -y python${PYTHON_VERSION} python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-venv \
31 - && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 \
32 - && update-alternatives --set python3 /usr/bin/python${PYTHON_VERSION} \
33 - && ln -sf /usr/bin/python${PYTHON_VERSION}-config /usr/bin/python3-config \
34 - && curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} \
35 - && python3 --version \
36 - && python3 -m pip --version
37 -# Install uv for faster pip installs
38 -RUN --mount=type=cache,target=/root/.cache/uv \
39 - python3 -m pip install uv
40 -
41 -# This timeout (in seconds) is necessary when installing some dependencies via uv since it's likely to time out
42 -# Reference: https://github.com/astral-sh/uv/pull/1694
43 -ENV UV_HTTP_TIMEOUT=500
44 -
45 -# GCC >= 11.3 required for PyTorch C++20 headers (pytorch/pytorch#167929).
46 -RUN apt-get install -y gcc-11 g++-11
47 -RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 --slave /usr/bin/g++ g++ /usr/bin/g++-11
48 -RUN <<EOF
49 -gcc --version
50 -EOF
51 -
52 -# Workaround for https://github.com/openai/triton/issues/2507 and
53 -# https://github.com/pytorch/pytorch/issues/107960 -- hopefully
54 -# this won't be needed for future versions of this docker image
55 -# or future versions of triton.
56 -RUN ldconfig /usr/local/cuda-$(echo $CUDA_VERSION | cut -d. -f1,2)/compat/
57 -
58 -WORKDIR /workspace
59 -
60 -# install build and runtime dependencies
61 -COPY requirements/common.txt requirements/common.txt
62 -COPY use_existing_torch.py use_existing_torch.py
63 -COPY pyproject.toml pyproject.toml
64 -
65 -# install build and runtime dependencies without stable torch version
66 -RUN python3 use_existing_torch.py
67 -
68 -# install torch nightly
69 -ARG PINNED_TORCH_VERSION
70 -RUN --mount=type=cache,target=/root/.cache/uv \
71 - if [ -n "$PINNED_TORCH_VERSION" ]; then \
72 - pkgs="$PINNED_TORCH_VERSION"; \
73 - else \
74 - pkgs="torch torchaudio torchvision"; \
75 - fi && \
76 - uv pip install --system $pkgs --index-url https://download.pytorch.org/whl/nightly/cu128
77 -
78 -RUN --mount=type=cache,target=/root/.cache/uv \
79 - uv pip install --system numba==0.65.0
80 -
81 -RUN --mount=type=cache,target=/root/.cache/uv \
82 -uv pip install --system -r requirements/common.txt
83 -
84 -# build can take a long time, and the torch nightly version fetched from url can be different in next docker stage.
85 -# track the nightly torch version used in the build, when we set up runtime environment we can make sure the version is the same
86 -RUN uv pip freeze | grep -i '^torch\|^torchvision\|^torchaudio' > torch_build_versions.txt
87 -RUN cat torch_build_versions.txt
88 -
89 -# cuda arch list used by torch
90 -# can be useful for `test`
91 -# explicitly set the list to avoid issues with torch 2.2
92 -# see https://github.com/pytorch/pytorch/pull/123243
93 -
94 -#################### BASE BUILD IMAGE ####################
95 -
96 -#################### RUST BUILD IMAGE ####################
97 -# Build the Rust frontend (`vllm-rs`) in a dedicated stage so the wheel build
98 -# stage doesn't need the rust toolchain or protoc.
99 -FROM ubuntu:22.04 AS rust-build
100 -ENV DEBIAN_FRONTEND=noninteractive
101 -
102 -RUN apt-get update -y \
103 - && apt-get install -y --no-install-recommends \
104 - ca-certificates curl git build-essential unzip python3 python3-pip \
105 - && rm -rf /var/lib/apt/lists/*
106 -
107 -COPY tools/install_protoc.sh /tmp/install_protoc.sh
108 -RUN /tmp/install_protoc.sh && rm /tmp/install_protoc.sh
109 -
110 -WORKDIR /workspace
111 -
112 -COPY requirements/build/rust.txt requirements/build/rust.txt
113 -RUN python3 -m pip install --no-cache-dir -r requirements/build/rust.txt
114 -
115 -# Copy only the Rust build inputs; build_rust.sh publishes artifacts needed
116 -# by the wheel build stage.
117 -COPY rust rust
118 -COPY rust-toolchain.toml rust-toolchain.toml
119 -COPY tools/build_rust.py tools/build_rust.py
120 -COPY build_rust.sh build_rust.sh
121 -
122 -# Cap cargo parallelism to avoid exhausting the CI host's open-file limit
123 -# (rustc spawns enough concurrent processes to hit RLIMIT_NOFILE otherwise).
124 -ENV CARGO_BUILD_JOBS=4
125 -
126 -RUN --mount=type=cache,target=/root/.cargo/registry,sharing=locked \
127 - --mount=type=cache,target=/root/.cargo/git,sharing=locked \
128 - bash build_rust.sh
129 -
130 -#################### RUST BUILD IMAGE ####################
131 -
132 -#################### WHEEL BUILD IMAGE ####################
133 -FROM base AS build
134 -ARG TARGETPLATFORM
135 -
136 -# This timeout (in seconds) is necessary when installing some dependencies via uv since it's likely to time out
137 -# Reference: https://github.com/astral-sh/uv/pull/1694
138 -ENV UV_HTTP_TIMEOUT=500
139 -
140 -COPY . .
141 -
142 -# Drop the pre-built Rust artifacts into the source tree. setup.py detects
143 -# them and ships them as-is, skipping the local Rust build.
144 -COPY --from=rust-build /workspace/vllm/vllm-rs vllm/vllm-rs
145 -COPY --from=rust-build /workspace/vllm/_rust_*.so vllm/
146 -
147 -RUN python3 use_existing_torch.py
148 -
149 -RUN --mount=type=cache,target=/root/.cache/uv \
150 - uv pip install --system -r requirements/build/cuda.txt
151 -
152 -ARG GIT_REPO_CHECK=0
153 -RUN --mount=type=bind,source=.git,target=.git \
154 - if [ "$GIT_REPO_CHECK" != "0" ]; then bash tools/check_repo.sh ; fi
155 -
156 -# Max jobs used by Ninja to build extensions
157 -ARG max_jobs=16
158 -ENV MAX_JOBS=${max_jobs}
159 -ARG nvcc_threads=2
160 -ENV NVCC_THREADS=$nvcc_threads
161 -
162 -ARG USE_SCCACHE
163 -ARG SCCACHE_BUCKET_NAME=vllm-build-sccache
164 -ARG SCCACHE_REGION_NAME=us-west-2
165 -ARG SCCACHE_S3_NO_CREDENTIALS=0
166 -
167 -# if USE_SCCACHE is set, use sccache to speed up compilation
168 -RUN --mount=type=cache,target=/root/.cache/uv \
169 - --mount=type=bind,source=.git,target=.git \
170 - if [ "$USE_SCCACHE" = "1" ]; then \
171 - echo "Installing sccache..." \
172 - && curl -L -o sccache.tar.gz https://github.com/mozilla/sccache/releases/download/v0.8.1/sccache-v0.8.1-x86_64-unknown-linux-musl.tar.gz \
173 - && tar -xzf sccache.tar.gz \
174 - && sudo mv sccache-v0.8.1-x86_64-unknown-linux-musl/sccache /usr/bin/sccache \
175 - && rm -rf sccache.tar.gz sccache-v0.8.1-x86_64-unknown-linux-musl \
176 - && export SCCACHE_BUCKET=${SCCACHE_BUCKET_NAME} \
177 - && export SCCACHE_REGION=${SCCACHE_REGION_NAME} \
178 - && export SCCACHE_S3_NO_CREDENTIALS=${SCCACHE_S3_NO_CREDENTIALS} \
179 - && export SCCACHE_IDLE_TIMEOUT=0 \
180 - && export CMAKE_BUILD_TYPE=Release \
181 - && sccache --show-stats \
182 - && python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38 \
183 - && sccache --show-stats; \
184 - fi
185 -
186 -ENV CCACHE_DIR=/root/.cache/ccache
187 -RUN --mount=type=cache,target=/root/.cache/ccache \
188 - --mount=type=cache,target=/root/.cache/uv \
189 - --mount=type=bind,source=.git,target=.git \
190 - if [ "$USE_SCCACHE" != "1" ]; then \
191 - # Clean any existing CMake artifacts
192 - rm -rf .deps && \
193 - mkdir -p .deps && \
194 - python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38; \
195 - fi
196 -
197 -#################### WHEEL BUILD IMAGE ####################
198 -
199 -################### VLLM INSTALLED IMAGE ####################
200 -# Setup clean environment for vLLM and its dependencies for test and api server using ubuntu22.04 with AOT flashinfer
201 -FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu22.04 AS vllm-base
202 -# prepare for environment starts
203 -ARG CUDA_VERSION=12.8.0
204 -ARG PYTHON_VERSION=3.12
205 -WORKDIR /vllm-workspace
206 -ENV DEBIAN_FRONTEND=noninteractive
207 -ARG TARGETPLATFORM
208 -
209 -RUN PYTHON_VERSION_STR=$(echo ${PYTHON_VERSION} | sed 's/\.//g') && \
210 - echo "export PYTHON_VERSION_STR=${PYTHON_VERSION_STR}" >> /etc/environment
211 -
212 -# Install Python and other dependencies
213 -RUN apt-get update -y \
214 - && apt-get install -y ccache software-properties-common git curl wget sudo vim python3-pip \
215 - && apt-get install -y ffmpeg libsm6 libxext6 libgl1 \
216 - && for i in 1 2 3; do \
217 - add-apt-repository -y ppa:deadsnakes/ppa && break || \
218 - { echo "Attempt $i failed, retrying in 5s..."; sleep 5; }; \
219 - done \
220 - && apt-get update -y \
221 - && apt-get install -y python${PYTHON_VERSION} python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-venv libibverbs-dev \
222 - && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 \
223 - && update-alternatives --set python3 /usr/bin/python${PYTHON_VERSION} \
224 - && ln -sf /usr/bin/python${PYTHON_VERSION}-config /usr/bin/python3-config \
225 - && curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} \
226 - && python3 --version && python3 -m pip --version
227 -
228 -RUN --mount=type=cache,target=/root/.cache/uv \
229 - python3 -m pip install uv
230 -
231 -# This timeout (in seconds) is necessary when installing some dependencies via uv since it's likely to time out
232 -# Reference: https://github.com/astral-sh/uv/pull/1694
233 -ENV UV_HTTP_TIMEOUT=500
234 -
235 -# Workaround for https://github.com/openai/triton/issues/2507 and
236 -# https://github.com/pytorch/pytorch/issues/107960 -- hopefully
237 -# this won't be needed for future versions of this docker image
238 -# or future versions of triton.
239 -RUN ldconfig /usr/local/cuda-$(echo $CUDA_VERSION | cut -d. -f1,2)/compat/
240 -
241 -# get the nightly torch version used in the build to make sure the version is the same
242 -COPY --from=base /workspace/torch_build_versions.txt ./torch_build_versions.txt
243 -
244 -RUN --mount=type=cache,target=/root/.cache/uv \
245 - uv pip install --system $(cat torch_build_versions.txt | xargs) --index-url https://download.pytorch.org/whl/nightly/cu128
246 -
247 -# install the vllm wheel
248 -RUN --mount=type=bind,from=build,src=/workspace/dist,target=/vllm-workspace/vllm-dist \
249 - --mount=type=cache,target=/root/.cache/uv \
250 - uv pip install --system vllm-dist/*.whl --verbose
251 -
252 -ARG torch_cuda_arch_list='8.0;8.6;8.9;9.0'
253 -
254 -# install package for build flashinfer
255 -# see issue: https://github.com/flashinfer-ai/flashinfer/issues/738
256 -RUN pip install setuptools==75.6.0 packaging==23.2 ninja==1.11.1.3 build==1.2.2.post1
257 -
258 -
259 -# build flashinfer for torch nightly from source around 10 mins
260 -# release version: v0.6.13
261 -# todo(elainewy): cache flashinfer build result for faster build
262 -ENV CCACHE_DIR=/root/.cache/ccache
263 -RUN --mount=type=cache,target=/root/.cache/ccache \
264 - --mount=type=cache,target=/root/.cache/uv \
265 - echo "git clone flashinfer..." \
266 - && git clone --depth 1 --branch v0.6.13 --recursive https://github.com/flashinfer-ai/flashinfer.git \
267 - && cd flashinfer \
268 - && git submodule update --init --recursive \
269 - && echo "finish git clone flashinfer..." \
270 - && rm -rf build \
271 - && export TORCH_CUDA_ARCH_LIST=${torch_cuda_arch_list} \
272 - && FLASHINFER_ENABLE_AOT=1 python3 setup.py bdist_wheel --dist-dir=../flashinfer-dist --verbose \
273 - && cd .. \
274 - && rm -rf flashinfer
275 -
276 -# install flashinfer
277 -RUN --mount=type=cache,target=/root/.cache/uv \
278 - uv pip install --system flashinfer-dist/*.whl --verbose
279 -
280 -# install common packages
281 -COPY requirements/common.txt requirements/common.txt
282 -COPY use_existing_torch.py use_existing_torch.py
283 -COPY pyproject.toml pyproject.toml
284 -
285 -COPY examples examples
286 -COPY benchmarks benchmarks
287 -COPY ./vllm/collect_env.py .
288 -
289 -RUN python3 use_existing_torch.py
290 -RUN --mount=type=cache,target=/root/.cache/uv \
291 - uv pip install --system -r requirements/common.txt
292 -
293 -################### VLLM INSTALLED IMAGE ####################
294 -
295 -
296 -#################### UNITTEST IMAGE #############################
297 -FROM vllm-base as test
298 -COPY tests/ tests/
299 -
300 -# install build and runtime dependencies without stable torch version
301 -COPY requirements/test/nightly-torch.txt requirements/test/nightly-torch.txt
302 -
303 -# This timeout (in seconds) is necessary when installing some dependencies via uv since it's likely to time out
304 -# Reference: https://github.com/astral-sh/uv/pull/1694
305 -ENV UV_HTTP_TIMEOUT=500
306 -
307 -# install development dependencies (for testing)
308 -RUN --mount=type=cache,target=/root/.cache/uv \
309 - uv pip install --system -e tests/vllm_test_utils
310 -
311 -# enable fast downloads from hf (for testing)
312 -ENV HF_XET_HIGH_PERFORMANCE 1
313 -
314 -# increase timeout for hf downloads (for testing)
315 -ENV HF_HUB_DOWNLOAD_TIMEOUT 60
316 -
317 -RUN --mount=type=cache,target=/root/.cache/uv \
318 - uv pip install --system -r requirements/test/nightly-torch.txt
319 -
320 -# Logging to confirm the torch versions
321 -RUN pip freeze | grep -E 'torch|vllm|flashinfer'
322 -
323 -# Logging to confirm all the packages are installed
324 -RUN pip freeze
325 -
326 -#################### UNITTEST IMAGE #############################