From e196268bade5291c3fd80906bf9cd8c64851b21b Mon Sep 17 00:00:00 2001 From: Andrey Talman Date: Wed, 1 Jul 2026 19:19:42 -0400 Subject: [PATCH] [Docker] Remove unused Dockerfile.nightly_torch (#47338) Co-authored-by: Andrey Talman --- docker/Dockerfile.nightly_torch | 326 -------------------------------- 1 file changed, 326 deletions(-) delete mode 100644 docker/Dockerfile.nightly_torch diff --git a/docker/Dockerfile.nightly_torch b/docker/Dockerfile.nightly_torch deleted file mode 100644 index cc706f59ae..0000000000 --- a/docker/Dockerfile.nightly_torch +++ /dev/null @@ -1,326 +0,0 @@ -####### -# -# THIS FILE IS DEPRECATED AND WILL BE REMOVED SHORTLY -# -# Please use the standard Dockerfile with PYTORCH_NIGHTLY=1 instead -# -####### - -# The vLLM Dockerfile is used to construct vLLM image against torch nightly that can be directly used for testing - -# for torch nightly, cuda >=12.6 is required, -# use 12.8 due to FlashAttention issue with cuda 12.6 (https://github.com/vllm-project/vllm/issues/15435#issuecomment-2775924628) -ARG CUDA_VERSION=12.8.0 -# -#################### BASE BUILD IMAGE #################### -# prepare basic build environment -FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu22.04 AS base -ARG CUDA_VERSION=12.8.0 -ARG PYTHON_VERSION=3.12 -ARG TARGETPLATFORM -ENV DEBIAN_FRONTEND=noninteractive -# Install Python and other dependencies -RUN apt-get update -y \ - && apt-get install -y ccache software-properties-common git curl sudo \ - && for i in 1 2 3; do \ - add-apt-repository -y ppa:deadsnakes/ppa && break || \ - { echo "Attempt $i failed, retrying in 5s..."; sleep 5; }; \ - done \ - && apt-get update -y \ - && apt-get install -y python${PYTHON_VERSION} python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-venv \ - && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 \ - && update-alternatives --set python3 /usr/bin/python${PYTHON_VERSION} \ - && ln -sf /usr/bin/python${PYTHON_VERSION}-config /usr/bin/python3-config \ - && curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} \ - && python3 --version \ - && python3 -m pip --version -# Install uv for faster pip installs -RUN --mount=type=cache,target=/root/.cache/uv \ - python3 -m pip install uv - -# This timeout (in seconds) is necessary when installing some dependencies via uv since it's likely to time out -# Reference: https://github.com/astral-sh/uv/pull/1694 -ENV UV_HTTP_TIMEOUT=500 - -# GCC >= 11.3 required for PyTorch C++20 headers (pytorch/pytorch#167929). -RUN apt-get install -y gcc-11 g++-11 -RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 --slave /usr/bin/g++ g++ /usr/bin/g++-11 -RUN < torch_build_versions.txt -RUN cat torch_build_versions.txt - -# cuda arch list used by torch -# can be useful for `test` -# explicitly set the list to avoid issues with torch 2.2 -# see https://github.com/pytorch/pytorch/pull/123243 - -#################### BASE BUILD IMAGE #################### - -#################### RUST BUILD IMAGE #################### -# Build the Rust frontend (`vllm-rs`) in a dedicated stage so the wheel build -# stage doesn't need the rust toolchain or protoc. -FROM ubuntu:22.04 AS rust-build -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -y \ - && apt-get install -y --no-install-recommends \ - ca-certificates curl git build-essential unzip python3 python3-pip \ - && rm -rf /var/lib/apt/lists/* - -COPY tools/install_protoc.sh /tmp/install_protoc.sh -RUN /tmp/install_protoc.sh && rm /tmp/install_protoc.sh - -WORKDIR /workspace - -COPY requirements/build/rust.txt requirements/build/rust.txt -RUN python3 -m pip install --no-cache-dir -r requirements/build/rust.txt - -# Copy only the Rust build inputs; build_rust.sh publishes artifacts needed -# by the wheel build stage. -COPY rust rust -COPY rust-toolchain.toml rust-toolchain.toml -COPY tools/build_rust.py tools/build_rust.py -COPY build_rust.sh build_rust.sh - -# Cap cargo parallelism to avoid exhausting the CI host's open-file limit -# (rustc spawns enough concurrent processes to hit RLIMIT_NOFILE otherwise). -ENV CARGO_BUILD_JOBS=4 - -RUN --mount=type=cache,target=/root/.cargo/registry,sharing=locked \ - --mount=type=cache,target=/root/.cargo/git,sharing=locked \ - bash build_rust.sh - -#################### RUST BUILD IMAGE #################### - -#################### WHEEL BUILD IMAGE #################### -FROM base AS build -ARG TARGETPLATFORM - -# This timeout (in seconds) is necessary when installing some dependencies via uv since it's likely to time out -# Reference: https://github.com/astral-sh/uv/pull/1694 -ENV UV_HTTP_TIMEOUT=500 - -COPY . . - -# Drop the pre-built Rust artifacts into the source tree. setup.py detects -# them and ships them as-is, skipping the local Rust build. -COPY --from=rust-build /workspace/vllm/vllm-rs vllm/vllm-rs -COPY --from=rust-build /workspace/vllm/_rust_*.so vllm/ - -RUN python3 use_existing_torch.py - -RUN --mount=type=cache,target=/root/.cache/uv \ - uv pip install --system -r requirements/build/cuda.txt - -ARG GIT_REPO_CHECK=0 -RUN --mount=type=bind,source=.git,target=.git \ - if [ "$GIT_REPO_CHECK" != "0" ]; then bash tools/check_repo.sh ; fi - -# Max jobs used by Ninja to build extensions -ARG max_jobs=16 -ENV MAX_JOBS=${max_jobs} -ARG nvcc_threads=2 -ENV NVCC_THREADS=$nvcc_threads - -ARG USE_SCCACHE -ARG SCCACHE_BUCKET_NAME=vllm-build-sccache -ARG SCCACHE_REGION_NAME=us-west-2 -ARG SCCACHE_S3_NO_CREDENTIALS=0 - -# if USE_SCCACHE is set, use sccache to speed up compilation -RUN --mount=type=cache,target=/root/.cache/uv \ - --mount=type=bind,source=.git,target=.git \ - if [ "$USE_SCCACHE" = "1" ]; then \ - echo "Installing sccache..." \ - && 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 \ - && tar -xzf sccache.tar.gz \ - && sudo mv sccache-v0.8.1-x86_64-unknown-linux-musl/sccache /usr/bin/sccache \ - && rm -rf sccache.tar.gz sccache-v0.8.1-x86_64-unknown-linux-musl \ - && export SCCACHE_BUCKET=${SCCACHE_BUCKET_NAME} \ - && export SCCACHE_REGION=${SCCACHE_REGION_NAME} \ - && export SCCACHE_S3_NO_CREDENTIALS=${SCCACHE_S3_NO_CREDENTIALS} \ - && export SCCACHE_IDLE_TIMEOUT=0 \ - && export CMAKE_BUILD_TYPE=Release \ - && sccache --show-stats \ - && python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38 \ - && sccache --show-stats; \ - fi - -ENV CCACHE_DIR=/root/.cache/ccache -RUN --mount=type=cache,target=/root/.cache/ccache \ - --mount=type=cache,target=/root/.cache/uv \ - --mount=type=bind,source=.git,target=.git \ - if [ "$USE_SCCACHE" != "1" ]; then \ - # Clean any existing CMake artifacts - rm -rf .deps && \ - mkdir -p .deps && \ - python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38; \ - fi - -#################### WHEEL BUILD IMAGE #################### - -################### VLLM INSTALLED IMAGE #################### -# Setup clean environment for vLLM and its dependencies for test and api server using ubuntu22.04 with AOT flashinfer -FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu22.04 AS vllm-base -# prepare for environment starts -ARG CUDA_VERSION=12.8.0 -ARG PYTHON_VERSION=3.12 -WORKDIR /vllm-workspace -ENV DEBIAN_FRONTEND=noninteractive -ARG TARGETPLATFORM - -RUN PYTHON_VERSION_STR=$(echo ${PYTHON_VERSION} | sed 's/\.//g') && \ - echo "export PYTHON_VERSION_STR=${PYTHON_VERSION_STR}" >> /etc/environment - -# Install Python and other dependencies -RUN apt-get update -y \ - && apt-get install -y ccache software-properties-common git curl wget sudo vim python3-pip \ - && apt-get install -y ffmpeg libsm6 libxext6 libgl1 \ - && for i in 1 2 3; do \ - add-apt-repository -y ppa:deadsnakes/ppa && break || \ - { echo "Attempt $i failed, retrying in 5s..."; sleep 5; }; \ - done \ - && apt-get update -y \ - && apt-get install -y python${PYTHON_VERSION} python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-venv libibverbs-dev \ - && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 \ - && update-alternatives --set python3 /usr/bin/python${PYTHON_VERSION} \ - && ln -sf /usr/bin/python${PYTHON_VERSION}-config /usr/bin/python3-config \ - && curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} \ - && python3 --version && python3 -m pip --version - -RUN --mount=type=cache,target=/root/.cache/uv \ - python3 -m pip install uv - -# This timeout (in seconds) is necessary when installing some dependencies via uv since it's likely to time out -# Reference: https://github.com/astral-sh/uv/pull/1694 -ENV UV_HTTP_TIMEOUT=500 - -# Workaround for https://github.com/openai/triton/issues/2507 and -# https://github.com/pytorch/pytorch/issues/107960 -- hopefully -# this won't be needed for future versions of this docker image -# or future versions of triton. -RUN ldconfig /usr/local/cuda-$(echo $CUDA_VERSION | cut -d. -f1,2)/compat/ - -# get the nightly torch version used in the build to make sure the version is the same -COPY --from=base /workspace/torch_build_versions.txt ./torch_build_versions.txt - -RUN --mount=type=cache,target=/root/.cache/uv \ - uv pip install --system $(cat torch_build_versions.txt | xargs) --index-url https://download.pytorch.org/whl/nightly/cu128 - -# install the vllm wheel -RUN --mount=type=bind,from=build,src=/workspace/dist,target=/vllm-workspace/vllm-dist \ - --mount=type=cache,target=/root/.cache/uv \ - uv pip install --system vllm-dist/*.whl --verbose - -ARG torch_cuda_arch_list='8.0;8.6;8.9;9.0' - -# install package for build flashinfer -# see issue: https://github.com/flashinfer-ai/flashinfer/issues/738 -RUN pip install setuptools==75.6.0 packaging==23.2 ninja==1.11.1.3 build==1.2.2.post1 - - -# build flashinfer for torch nightly from source around 10 mins -# release version: v0.6.13 -# todo(elainewy): cache flashinfer build result for faster build -ENV CCACHE_DIR=/root/.cache/ccache -RUN --mount=type=cache,target=/root/.cache/ccache \ - --mount=type=cache,target=/root/.cache/uv \ - echo "git clone flashinfer..." \ - && git clone --depth 1 --branch v0.6.13 --recursive https://github.com/flashinfer-ai/flashinfer.git \ - && cd flashinfer \ - && git submodule update --init --recursive \ - && echo "finish git clone flashinfer..." \ - && rm -rf build \ - && export TORCH_CUDA_ARCH_LIST=${torch_cuda_arch_list} \ - && FLASHINFER_ENABLE_AOT=1 python3 setup.py bdist_wheel --dist-dir=../flashinfer-dist --verbose \ - && cd .. \ - && rm -rf flashinfer - -# install flashinfer -RUN --mount=type=cache,target=/root/.cache/uv \ - uv pip install --system flashinfer-dist/*.whl --verbose - -# install common packages -COPY requirements/common.txt requirements/common.txt -COPY use_existing_torch.py use_existing_torch.py -COPY pyproject.toml pyproject.toml - -COPY examples examples -COPY benchmarks benchmarks -COPY ./vllm/collect_env.py . - -RUN python3 use_existing_torch.py -RUN --mount=type=cache,target=/root/.cache/uv \ - uv pip install --system -r requirements/common.txt - -################### VLLM INSTALLED IMAGE #################### - - -#################### UNITTEST IMAGE ############################# -FROM vllm-base as test -COPY tests/ tests/ - -# install build and runtime dependencies without stable torch version -COPY requirements/test/nightly-torch.txt requirements/test/nightly-torch.txt - -# This timeout (in seconds) is necessary when installing some dependencies via uv since it's likely to time out -# Reference: https://github.com/astral-sh/uv/pull/1694 -ENV UV_HTTP_TIMEOUT=500 - -# install development dependencies (for testing) -RUN --mount=type=cache,target=/root/.cache/uv \ - uv pip install --system -e tests/vllm_test_utils - -# enable fast downloads from hf (for testing) -ENV HF_XET_HIGH_PERFORMANCE 1 - -# increase timeout for hf downloads (for testing) -ENV HF_HUB_DOWNLOAD_TIMEOUT 60 - -RUN --mount=type=cache,target=/root/.cache/uv \ - uv pip install --system -r requirements/test/nightly-torch.txt - -# Logging to confirm the torch versions -RUN pip freeze | grep -E 'torch|vllm|flashinfer' - -# Logging to confirm all the packages are installed -RUN pip freeze - -#################### UNITTEST IMAGE #############################