[Refactor] Move auxiliary files out of the repository root (#58572)

Signed-off-by: mgoin <mgoin64@gmail.com>
This commit is contained in:
Misha Goin
2026-09-24 12:38:56 -07:00
committed by GitHub
parent cd06e81c41
commit 58aa2f1ef1
35 changed files with 134 additions and 130 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ run_all_patterns:
- "requirements/test/rocm.txt"
- "pyproject.toml"
- "setup.py"
- "build_rust.sh"
- "tools/build_rust.sh"
- "rust/"
- "rust-toolchain.toml"
- "tools/build_rust.py"
+1 -1
View File
@@ -23,7 +23,7 @@ DEFAULT_CI_BASE_METADATA_VERSION="3"
# local-source stages rather than unreachable remote-fetch alternatives.
DEFAULT_ROCM_CSRC_CONTENT_FILES=".dockerignore requirements/common.txt requirements/rocm.txt pyproject.toml setup.py CMakeLists.txt cmake csrc vllm/envs.py vllm/__init__.py tools/build_rust.py"
DEFAULT_ROCM_CSRC_DOCKERFILE_STAGES="base fetch_vllm_0 fetch_vllm build_vllm_dependencies rocm-triton-kernels csrc-build"
DEFAULT_ROCM_RUST_CONTENT_FILES=".dockerignore .git_archival.txt pyproject.toml requirements/build/rust.txt rust/Cargo.lock rust/Cargo.toml rust/proto rust/src rust-toolchain.toml tools/build_rust.py build_rust.sh"
DEFAULT_ROCM_RUST_CONTENT_FILES=".dockerignore .git_archival.txt pyproject.toml requirements/build/rust.txt rust/Cargo.lock rust/Cargo.toml rust/proto rust/src rust-toolchain.toml tools/build_rust.py tools/build_rust.sh"
DEFAULT_ROCM_RUST_DOCKERFILE_STAGES="base fetch_vllm_0 fetch_vllm vllm-version rust_toolchain_input_0 rust-toolchain-input rust_input_0 rust-input rust-toolchain rust-build"
# Docker's 128-character tag limit minus the longest cache prefix
# ("csrc-rocm-branch-" and "rust-rocm-branch-", both 17 characters).
@@ -5,7 +5,7 @@
set -ex
# Skip the new torch installation during build since we are using the specified version for arm64 in the Dockerfile
python3 use_existing_torch.py
python3 tools/use_existing_torch.py
# Try building the docker image
DOCKER_BUILDKIT=1 docker build . \
+1 -1
View File
@@ -327,7 +327,7 @@ steps:
working_dir: "/vllm-workspace/tests"
source_file_dependencies:
- vllm/utils/import_utils.py
- scripts/benchmark_helion_kernels.py
- tools/benchmark_helion_kernels.py
- tests/kernels/helion/
- vllm/platforms/rocm.py
commands:
+1 -1
View File
@@ -612,7 +612,7 @@ steps:
- image-build-amd
source_file_dependencies:
- vllm/platforms/rocm.py
- scripts/benchmark_helion_kernels.py
- tools/benchmark_helion_kernels.py
- label: ":nvidia: (H100) FP8 MoE Kernels"
-47
View File
@@ -1,47 +0,0 @@
[run]
# Track the installed vllm package (this is what actually gets imported during tests)
# Use wildcard pattern to match the installed location
source =
vllm
*/dist-packages/vllm
*/site-packages/vllm
omit =
*/tests/*
*/test_*
*/__pycache__/*
*/build/*
*/dist/*
*/vllm.egg-info/*
*/third_party/*
*/examples/*
*/benchmarks/*
*/docs/*
[paths]
# Map all possible vllm locations to a canonical "vllm" path
# This ensures coverage.combine properly merges data from different test runs
source =
vllm
/vllm-workspace/src/vllm
/vllm-workspace/vllm
*/site-packages/vllm
*/dist-packages/vllm
[report]
exclude_lines =
pragma: no cover
def __repr__
if self.debug:
if settings.DEBUG
raise AssertionError
raise NotImplementedError
if 0:
if __name__ == .__main__.:
class .*\bProtocol\):
@(abc\.)?abstractmethod
[html]
directory = htmlcov
[xml]
output = coverage.xml
+2 -2
View File
@@ -50,7 +50,7 @@
# Rust Frontend
/rust/ @BugenZhao @njhill
/rust/src/bench @esmeetu
/build_rust.sh @BugenZhao @njhill
/tools/build_rust.sh @BugenZhao @njhill
/rust-toolchain.toml @BugenZhao @njhill
/.buildkite/test_areas/rust* @BugenZhao @njhill
@@ -134,7 +134,7 @@
mkdocs.yaml @hmellor
# Linting
.markdownlint.yaml @hmellor
/tools/pre_commit/.markdownlint.yaml @hmellor
.pre-commit-config.yaml @hmellor
/tools/pre_commit @hmellor
View File
+2 -2
View File
@@ -29,7 +29,7 @@ repos:
hooks:
- id: markdownlint-cli2
language_version: lts
args: [--fix]
args: [--config, tools/pre_commit/.markdownlint.yaml, --fix]
exclude: (^|/)CLAUDE\.md$
- repo: https://github.com/rhysd/actionlint
rev: v1.7.7
@@ -39,7 +39,7 @@ repos:
rev: 745eface02aef23e168a8afb6b5737818efbea95 # v0.11.0.1
hooks:
- id: shellcheck
args: ["-s", "bash", "--format=gcc"]
args: ["-s", "bash", "--format=gcc", "--rcfile=tools/pre_commit/.shellcheckrc"]
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.11.1
hooks:
+19 -19
View File
@@ -207,7 +207,7 @@ ARG PYTORCH_NIGHTLY
# Check whether to install torch nightly instead of release for this build
COPY requirements/common.txt requirements/common.txt
COPY requirements/cuda.txt requirements/cuda.txt
COPY use_existing_torch.py use_existing_torch.py
COPY tools/use_existing_torch.py tools/use_existing_torch.py
COPY pyproject.toml pyproject.toml
RUN --mount=type=cache,target=/opt/uv/cache \
--mount=type=bind,source=requirements,target=/tmp/vllm-requirements,ro \
@@ -229,7 +229,7 @@ RUN --mount=type=cache,target=/opt/uv/cache \
fi \
&& if [ "${INSTALL_RUBIN_PRERELEASE}" = "true" ]; then \
echo "Installing Rubin prerelease requirements..." \
&& /opt/venv/bin/python3 use_existing_torch.py --prefix \
&& /opt/venv/bin/python3 tools/use_existing_torch.py --prefix \
&& uv pip install --python /opt/venv/bin/python3 \
--prerelease=allow --index-strategy unsafe-first-match \
-r /tmp/vllm-requirements/rubin-prerelease.txt \
@@ -243,7 +243,7 @@ RUN --mount=type=cache,target=/opt/uv/cache \
&& uv pip install --python /opt/venv/bin/python3 torch torchaudio torchvision --pre \
--index-url ${PYTORCH_CUDA_INDEX_BASE_URL}/nightly/cu$(echo $CUDA_VERSION | cut -d. -f1,2 | tr -d '.') \
&& echo "Installing other requirements..." \
&& /opt/venv/bin/python3 use_existing_torch.py --prefix \
&& /opt/venv/bin/python3 tools/use_existing_torch.py --prefix \
&& uv pip install --python /opt/venv/bin/python3 -r requirements/cuda.txt \
--extra-index-url ${PYTORCH_CUDA_INDEX_BASE_URL}/nightly/cu$(echo $CUDA_VERSION | cut -d. -f1,2 | tr -d '.'); \
else \
@@ -316,12 +316,12 @@ COPY requirements/build/rust.txt requirements/build/rust.txt
RUN --mount=type=cache,target=/opt/uv/cache \
uv pip install --python /opt/venv/bin/python3 -r requirements/build/rust.txt
# Copy only the Rust build inputs; build_rust.sh publishes artifacts needed
# Copy only the Rust build inputs; tools/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
COPY tools/build_rust.sh tools/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).
@@ -341,7 +341,7 @@ RUN --mount=type=cache,target=/root/.cargo/registry,sharing=locked \
export RUSTC_WRAPPER=sccache; \
sccache --show-stats; \
fi \
&& SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0+docker.cache" bash build_rust.sh \
&& SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0+docker.cache" bash tools/build_rust.sh \
&& if [ "$USE_SCCACHE" = "1" ]; then \
sccache --show-stats; \
fi
@@ -352,7 +352,7 @@ FROM rust-build-cache AS rust-build
RUN --mount=type=cache,target=/root/.cargo/registry,sharing=locked \
--mount=type=cache,target=/root/.cargo/git,sharing=locked \
--mount=type=bind,source=.git,target=.git \
SETUPTOOLS_SCM_PRETEND_METADATA="{dirty=false}" bash build_rust.sh
SETUPTOOLS_SCM_PRETEND_METADATA="{dirty=false}" bash tools/build_rust.sh
#################### RUST BUILD IMAGE ####################
#################### CSRC BUILD IMAGE ####################
@@ -368,7 +368,7 @@ ARG PYTORCH_NIGHTLY
# Install build dependencies
COPY requirements/build/cuda.txt requirements/build/cuda.txt
COPY use_existing_torch.py use_existing_torch.py
COPY tools/use_existing_torch.py tools/use_existing_torch.py
COPY --from=base /workspace/torch_lib_versions.txt torch_lib_versions.txt
# This timeout (in seconds) is necessary when installing some dependencies via uv since it's likely to time out
@@ -381,11 +381,11 @@ ENV UV_LINK_MODE=copy
RUN --mount=type=cache,target=/opt/uv/cache \
if [ "${INSTALL_RUBIN_PRERELEASE}" = "true" ]; then \
echo "Installing build requirements with Rubin prerelease PyTorch..." \
&& python3 use_existing_torch.py --prefix \
&& python3 tools/use_existing_torch.py --prefix \
&& uv pip install --python /opt/venv/bin/python3 -r requirements/build/cuda.txt; \
elif [ "${PYTORCH_NIGHTLY}" = "1" ]; then \
echo "Installing build requirements without torch..." \
&& python3 use_existing_torch.py --prefix \
&& python3 tools/use_existing_torch.py --prefix \
&& uv pip install --python /opt/venv/bin/python3 -r requirements/build/cuda.txt \
&& echo "Installing torch nightly..." \
&& uv pip install --python /opt/venv/bin/python3 $(cat torch_lib_versions.txt | grep -i "^torch=" | xargs) --pre \
@@ -427,7 +427,7 @@ ENV SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0+csrc.build"
RUN --mount=type=cache,target=/opt/uv/cache \
if [ "${PYTORCH_NIGHTLY}" = "1" ] || \
[ "${INSTALL_RUBIN_PRERELEASE}" = "true" ]; then \
python3 use_existing_torch.py --prefix; \
python3 tools/use_existing_torch.py --prefix; \
fi
# Provision one bare Python per `requires-python` entry; cmake reads
@@ -605,7 +605,7 @@ ARG PYTORCH_NIGHTLY
# Install build dependencies
COPY requirements/build/cuda.txt requirements/build/cuda.txt
COPY use_existing_torch.py use_existing_torch.py
COPY tools/use_existing_torch.py tools/use_existing_torch.py
COPY --from=base /workspace/torch_lib_versions.txt torch_lib_versions.txt
# This timeout (in seconds) is necessary when installing some dependencies via uv since it's likely to time out
@@ -618,11 +618,11 @@ ENV UV_LINK_MODE=copy
RUN --mount=type=cache,target=/opt/uv/cache \
if [ "${INSTALL_RUBIN_PRERELEASE}" = "true" ]; then \
echo "Installing build requirements with Rubin prerelease PyTorch..." \
&& python3 use_existing_torch.py --prefix \
&& python3 tools/use_existing_torch.py --prefix \
&& uv pip install --python /opt/venv/bin/python3 -r requirements/build/cuda.txt; \
elif [ "${PYTORCH_NIGHTLY}" = "1" ]; then \
echo "Installing build requirements without torch..." \
&& python3 use_existing_torch.py --prefix \
&& python3 tools/use_existing_torch.py --prefix \
&& uv pip install --python /opt/venv/bin/python3 -r requirements/build/cuda.txt \
&& echo "Installing torch nightly..." \
&& uv pip install --python /opt/venv/bin/python3 $(cat torch_lib_versions.txt | grep -i "^torch=" | xargs) --pre \
@@ -658,7 +658,7 @@ ENV VLLM_SKIP_PRECOMPILED_VERSION_SUFFIX=1
RUN --mount=type=cache,target=/opt/uv/cache \
if [ "${PYTORCH_NIGHTLY}" = "1" ] || \
[ "${INSTALL_RUBIN_PRERELEASE}" = "true" ]; then \
python3 use_existing_torch.py --prefix; \
python3 tools/use_existing_torch.py --prefix; \
fi \
&& if [ "${INSTALL_RUBIN_PRERELEASE}" = "true" ]; then \
sed -Ei '/^[[:space:]]*(flashinfer-python|nvidia-cutlass-dsl\[cu13\]|quack-kernels)[[:space:]]*==/Id' \
@@ -729,12 +729,12 @@ COPY requirements/lint.txt requirements/lint.txt
COPY requirements/test/cuda.in requirements/test/cuda.in
COPY requirements/test/cuda.txt requirements/test/cuda.txt
COPY requirements/dev.txt requirements/dev.txt
COPY use_existing_torch.py use_existing_torch.py
COPY tools/use_existing_torch.py tools/use_existing_torch.py
COPY --from=base /workspace/torch_lib_versions.txt torch_lib_versions.txt
RUN --mount=type=cache,target=/opt/uv/cache \
if [ "${PYTORCH_NIGHTLY}" = "1" ]; then \
echo "Installing dev requirements plus torch nightly..." \
&& python3 use_existing_torch.py --prefix \
&& python3 tools/use_existing_torch.py --prefix \
&& cat torch_lib_versions.txt >> requirements/test/cuda.in \
&& uv pip compile requirements/test/cuda.in -o requirements/test/cuda.txt --index-strategy unsafe-best-match \
--extra-index-url ${PYTORCH_CUDA_INDEX_BASE_URL}/nightly/cu$(echo $CUDA_VERSION | cut -d. -f1,2 | tr -d '.') \
@@ -1143,14 +1143,14 @@ COPY requirements/lint.txt requirements/lint.txt
COPY requirements/test/cuda.in requirements/test/cuda.in
COPY requirements/test/cuda.txt requirements/test/cuda.txt
COPY requirements/dev.txt requirements/dev.txt
COPY use_existing_torch.py use_existing_torch.py
COPY tools/use_existing_torch.py tools/use_existing_torch.py
COPY --from=base /workspace/torch_lib_versions.txt torch_lib_versions.txt
RUN --mount=type=cache,target=/opt/uv/cache \
CUDA_MAJOR="${CUDA_VERSION%%.*}"; \
if [ "$CUDA_MAJOR" -ge 12 ]; then \
if [ "${PYTORCH_NIGHTLY}" = "1" ]; then \
echo "Installing dev requirements plus torch nightly..." \
&& python3 use_existing_torch.py --prefix \
&& python3 tools/use_existing_torch.py --prefix \
&& cat torch_lib_versions.txt >> requirements/test/cuda.in \
&& uv pip compile requirements/test/cuda.in -o requirements/test/cuda.txt --index-strategy unsafe-best-match \
--extra-index-url ${PYTORCH_CUDA_INDEX_BASE_URL}/nightly/cu$(echo $CUDA_VERSION | cut -d. -f1,2 | tr -d '.') \
+11 -11
View File
@@ -119,10 +119,10 @@ ARG PYTORCH_CPU_INDEX_BASE_URL=https://download.pytorch.org/whl
# Copy requirements files for installation
COPY requirements/common.txt requirements/common.txt
COPY requirements/cpu.txt requirements/cpu.txt
COPY use_existing_torch.py use_existing_torch.py
COPY tools/use_existing_torch.py tools/use_existing_torch.py
# For nightly: install torch nightly (CPU) first, strip torch pins from the
# requirements via use_existing_torch.py so they can't pull it back to a release
# requirements via tools/use_existing_torch.py so they can't pull it back to a release
# build, then install the rest from the nightly CPU index (no --torch-backend,
# which would force the stable channel). Release path is unchanged.
RUN --mount=type=cache,target=/root/.cache/uv \
@@ -131,7 +131,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
echo "Installing torch nightly (CPU)..." \
&& uv pip install torch torchaudio torchvision torchcodec --pre \
--index-url ${PYTORCH_CPU_INDEX_BASE_URL}/nightly/cpu \
&& python3 use_existing_torch.py --prefix \
&& python3 tools/use_existing_torch.py --prefix \
&& uv pip install -r requirements/cpu.txt \
--extra-index-url ${PYTORCH_CPU_INDEX_BASE_URL}/nightly/cpu; \
else \
@@ -183,12 +183,12 @@ ENV SCCACHE_REGION=${USE_SCCACHE:+${SCCACHE_REGION_NAME}}
# Avoid port collision with vllm-build's own sccache daemon.
ENV SCCACHE_SERVER_PORT=4227
# Copy only the Rust build inputs; build_rust.sh publishes artifacts needed
# Copy only the Rust build inputs; tools/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
COPY tools/build_rust.sh tools/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).
@@ -210,10 +210,10 @@ RUN --mount=type=cache,target=/root/.cargo/registry,sharing=locked \
fi; \
sccache --show-stats; \
fi && \
SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0+docker.cache" bash build_rust.sh && \
SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0+docker.cache" bash tools/build_rust.sh && \
if [ "$USE_SCCACHE" = "1" ]; then sccache --show-stats; fi
# build_rust.sh installed rustup here via rustup.rs; put it on PATH so the
# tools/build_rust.sh installed rustup here via rustup.rs; put it on PATH so the
# child stage below finds it on disk instead of re-downloading it.
ENV PATH="/root/.cargo/bin:${PATH}"
@@ -223,7 +223,7 @@ FROM rust-build-cache AS rust-build
RUN --mount=type=cache,target=/root/.cargo/registry,sharing=locked \
--mount=type=cache,target=/root/.cargo/git,sharing=locked \
--mount=type=bind,source=.git,target=.git \
SETUPTOOLS_SCM_PRETEND_METADATA="{dirty=false}" bash build_rust.sh
SETUPTOOLS_SCM_PRETEND_METADATA="{dirty=false}" bash tools/build_rust.sh
######################### SOURCE PREP IMAGE #########################
# Shared prep (source, rust artifacts, build deps) for both vllm-build and
@@ -262,7 +262,7 @@ COPY requirements/build/cpu.txt requirements/build/cpu.txt
RUN --mount=type=cache,target=/root/.cache/uv \
if [ "${PYTORCH_NIGHTLY}" = "1" ]; then \
python3 /workspace/use_existing_torch.py --prefix \
python3 /workspace/tools/use_existing_torch.py --prefix \
&& uv pip install -r requirements/build/cpu.txt \
--extra-index-url ${PYTORCH_CPU_INDEX_BASE_URL}/nightly/cpu; \
else \
@@ -287,7 +287,7 @@ RUN if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh ; fi
# now-unpinned dependency. Done at the end of vllm-src so vllm-build and
# vllm-dev, which both derive from it, inherit the unpinned tree.
RUN if [ "${PYTORCH_NIGHTLY}" = "1" ]; then \
python3 /workspace/use_existing_torch.py --prefix; \
python3 /workspace/tools/use_existing_torch.py --prefix; \
fi
######################### BUILD IMAGE #########################
@@ -343,7 +343,7 @@ RUN case "$(uname -m)" in \
RUN --mount=type=cache,target=/root/.cache/uv \
export CFLAGS="${CFLAGS:+${CFLAGS} }-std=gnu17" && \
if [ "${PYTORCH_NIGHTLY}" = "1" ]; then \
python3 /workspace/use_existing_torch.py --prefix \
python3 /workspace/tools/use_existing_torch.py --prefix \
&& uv pip install -r requirements/test/cpu.txt \
--extra-index-url ${PYTORCH_CPU_INDEX_BASE_URL}/nightly/cpu; \
else \
+2 -2
View File
@@ -36,10 +36,10 @@ COPY pyproject.toml ./
# The script is expected to install whatever python dependencies are missing
# as well as whatever system libraries need to be installed from source
COPY build_vllm_*.sh ./
COPY docker/build_vllm_*.sh docker/
RUN --mount=type=cache,target=/root/.cache/uv \
sh ./build_vllm_$(uname -m).sh
sh ./docker/build_vllm_$(uname -m).sh
# copy vllm source code to build cache
COPY . .
+6 -6
View File
@@ -171,7 +171,7 @@ COPY rust/proto /rust-input/vllm/rust/proto
COPY rust/src /rust-input/vllm/rust/src
COPY rust-toolchain.toml /rust-input/vllm/rust-toolchain.toml
COPY tools/build_rust.py /rust-input/vllm/tools/build_rust.py
COPY build_rust.sh /rust-input/vllm/build_rust.sh
COPY tools/build_rust.sh /rust-input/vllm/tools/build_rust.sh
FROM base AS rust_input_1
ARG VLLM_REPO
@@ -188,7 +188,7 @@ RUN git clone --no-checkout --filter=blob:none ${VLLM_REPO} /rust-input/vllm \
rust/src/** \
rust-toolchain.toml \
tools/build_rust.py \
build_rust.sh \
tools/build_rust.sh \
&& git checkout FETCH_HEAD
FROM rust_input_${REMOTE_VLLM} AS rust-input
@@ -244,7 +244,7 @@ RUN --mount=type=cache,id=vllm-rocm-uv,target=/root/.cache/uv \
COPY --from=rust-input /rust-input/vllm/rust rust
COPY --from=rust-input /rust-input/vllm/rust-toolchain.toml rust-toolchain.toml
COPY --from=rust-input /rust-input/vllm/tools/build_rust.py tools/build_rust.py
COPY --from=rust-input /rust-input/vllm/build_rust.sh build_rust.sh
COPY --from=rust-input /rust-input/vllm/tools/build_rust.sh tools/build_rust.sh
COPY --from=vllm-version /vllm-version.txt /tmp/vllm-version.txt
# Build the release binary. Cargo's registry/git caches can be written by
@@ -258,7 +258,7 @@ RUN --mount=type=cache,id=vllm-rocm-cargo-registry,target=/root/.cargo/registry,
&& sccache --show-stats; \
fi \
&& export SETUPTOOLS_SCM_PRETEND_VERSION="$(cat /tmp/vllm-version.txt)" \
&& bash build_rust.sh \
&& bash tools/build_rust.sh \
&& test -x vllm/vllm-rs \
&& if [ "$USE_SCCACHE" = "1" ]; then \
sccache --show-stats; \
@@ -368,7 +368,7 @@ COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/requirements /requirements
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/benchmarks /benchmarks
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/tests /tests
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/examples /examples
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/scripts/benchmark_helion_kernels.py /scripts/benchmark_helion_kernels.py
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/tools/benchmark_helion_kernels.py /tools/benchmark_helion_kernels.py
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/tools/install_torchcodec_rocm.sh /tools/install_torchcodec_rocm.sh
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/docker/Dockerfile /docker/Dockerfile
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/docker/Dockerfile.cpu /docker/Dockerfile.cpu
@@ -729,7 +729,7 @@ COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/requirements /requir
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/benchmarks /benchmarks
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/tests /tests
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/examples /examples
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/scripts/benchmark_helion_kernels.py /scripts/benchmark_helion_kernels.py
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/tools/benchmark_helion_kernels.py /tools/benchmark_helion_kernels.py
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/tools/install_torchcodec_rocm.sh /tools/install_torchcodec_rocm.sh
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/docker/Dockerfile /docker/Dockerfile
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/docker/Dockerfile.cpu /docker/Dockerfile.cpu
+4 -6
View File
@@ -171,7 +171,7 @@ COPY rust/proto /rust-input/vllm/rust/proto
COPY rust/src /rust-input/vllm/rust/src
COPY rust-toolchain.toml /rust-input/vllm/rust-toolchain.toml
COPY tools/build_rust.py /rust-input/vllm/tools/build_rust.py
COPY build_rust.sh /rust-input/vllm/build_rust.sh
COPY tools/build_rust.sh /rust-input/vllm/tools/build_rust.sh
FROM base AS rust_input_1
ARG VLLM_REPO
@@ -188,7 +188,7 @@ RUN git clone --no-checkout --filter=blob:none ${VLLM_REPO} /rust-input/vllm \
rust/src/** \
rust-toolchain.toml \
tools/build_rust.py \
build_rust.sh \
tools/build_rust.sh \
&& git checkout FETCH_HEAD
FROM rust_input_${REMOTE_VLLM} AS rust-input
@@ -244,7 +244,7 @@ RUN --mount=type=cache,id=vllm-rocm-uv,target=/root/.cache/uv \
COPY --from=rust-input /rust-input/vllm/rust rust
COPY --from=rust-input /rust-input/vllm/rust-toolchain.toml rust-toolchain.toml
COPY --from=rust-input /rust-input/vllm/tools/build_rust.py tools/build_rust.py
COPY --from=rust-input /rust-input/vllm/build_rust.sh build_rust.sh
COPY --from=rust-input /rust-input/vllm/tools/build_rust.sh tools/build_rust.sh
COPY --from=vllm-version /vllm-version.txt /tmp/vllm-version.txt
# Build the release binary. Cargo's registry/git caches can be written by
@@ -258,7 +258,7 @@ RUN --mount=type=cache,id=vllm-rocm-cargo-registry,target=/root/.cargo/registry,
&& sccache --show-stats; \
fi \
&& export SETUPTOOLS_SCM_PRETEND_VERSION="$(cat /tmp/vllm-version.txt)" \
&& bash build_rust.sh \
&& bash tools/build_rust.sh \
&& test -x vllm/vllm-rs \
&& if [ "$USE_SCCACHE" = "1" ]; then \
sccache --show-stats; \
@@ -366,7 +366,6 @@ COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/requirements /requirements
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/benchmarks /benchmarks
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/tests /tests
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/examples /examples
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/scripts/benchmark_helion_kernels.py /scripts/benchmark_helion_kernels.py
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/tools /tools
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/docker/Dockerfile /docker/Dockerfile
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/docker/Dockerfile.cpu /docker/Dockerfile.cpu
@@ -749,7 +748,6 @@ COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/requirements /requir
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/benchmarks /benchmarks
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/tests /tests
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/examples /examples
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/scripts/benchmark_helion_kernels.py /scripts/benchmark_helion_kernels.py
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/tools /tools
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/docker/Dockerfile /docker/Dockerfile
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/docker/Dockerfile.cpu /docker/Dockerfile.cpu
+1 -1
View File
@@ -166,7 +166,7 @@ RUN --mount=type=cache,id=vllm-rocm-cargo-registry,target=/root/.cargo/registry,
--mount=type=cache,id=vllm-rocm-cargo-git,target=/root/.cargo/git,sharing=locked \
cd ${COMMON_WORKDIR}/vllm \
&& export SETUPTOOLS_SCM_PRETEND_VERSION="$(cat /tmp/vllm-version.txt)" \
&& bash build_rust.sh \
&& bash tools/build_rust.sh \
&& test -x vllm/vllm-rs
# -----------------------
+4 -4
View File
@@ -14,12 +14,12 @@ 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
# Copy only the Rust build inputs; tools/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
COPY tools/build_rust.sh tools/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).
@@ -29,7 +29,7 @@ ENV CARGO_BUILD_JOBS=4
# inputs. The child stage below relinks the crates that embed the exact version.
RUN --mount=type=cache,target=/root/.cargo/registry,sharing=locked \
--mount=type=cache,target=/root/.cargo/git,sharing=locked \
SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0+docker.cache" bash build_rust.sh
SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0+docker.cache" bash tools/build_rust.sh
# Relink with the exact Git-derived package version.
FROM rust-build-cache AS rust-build
@@ -37,7 +37,7 @@ FROM rust-build-cache AS rust-build
RUN --mount=type=cache,target=/root/.cargo/registry,sharing=locked \
--mount=type=cache,target=/root/.cargo/git,sharing=locked \
--mount=type=bind,source=.git,target=.git \
SETUPTOOLS_SCM_PRETEND_METADATA="{dirty=false}" bash build_rust.sh
SETUPTOOLS_SCM_PRETEND_METADATA="{dirty=false}" bash tools/build_rust.sh
FROM ubuntu:24.04 AS vllm-base
+7 -2
View File
@@ -46,8 +46,8 @@ VLLM_USE_PRECOMPILED=1 uv pip install -e .
To rebuild only the Rust frontend binary:
```bash
./build_rust.sh # release build
./build_rust.sh --debug # faster build for development
./tools/build_rust.sh # release build
./tools/build_rust.sh --debug # faster build for development
```
If you are developing vLLM's Python and CUDA/C++ code, install PyTorch first:
@@ -89,6 +89,11 @@ pre-commit install
vLLM's `pre-commit` hooks will now run automatically every time you commit.
When running ShellCheck or markdownlint directly, or configuring an editor
integration, use the configuration files in `tools/pre_commit/`:
`--rcfile=tools/pre_commit/.shellcheckrc` for ShellCheck and
`--config tools/pre_commit/.markdownlint.yaml` for markdownlint-cli2.
!!! tip "Tips"
You can manually run the `pre-commit` hooks using:
@@ -111,8 +111,8 @@ This command will do the following:
If you need to recompile the `vllm-rs` Rust frontend binary, you can rebuild and install it without re-running the full pip install:
```bash
./build_rust.sh # release build
./build_rust.sh --debug # faster build for development
./tools/build_rust.sh # release build
./tools/build_rust.sh --debug # faster build for development
```
This will install the required Rust toolchain if needed, build the binary, and place it in `vllm/vllm-rs`.
@@ -183,7 +183,7 @@ To build vLLM using an existing PyTorch installation:
# install PyTorch first, either from PyPI or from source
git clone https://github.com/vllm-project/vllm.git
cd vllm
python use_existing_torch.py
python tools/use_existing_torch.py
uv pip install -r requirements/build/cuda.txt
uv pip install --no-build-isolation -e .
```
@@ -187,8 +187,8 @@ If you need to recompile the `vllm-rs` Rust frontend binary, you can rebuild and
install it without re-running the full installation:
```bash
./build_rust.sh # release build
./build_rust.sh --debug # faster build for development
./tools/build_rust.sh # release build
./tools/build_rust.sh --debug # faster build for development
```
This will install the required Rust toolchain if needed, build the binary,
+48
View File
@@ -130,6 +130,54 @@ markers = [
"optional: optional tests that are automatically skipped, include --optional to run them",
]
[tool.coverage.run]
# Track the installed vllm package (this is what actually gets imported during tests)
# Use wildcard pattern to match the installed location
source = ["vllm", "*/dist-packages/vllm", "*/site-packages/vllm"]
omit = [
"*/tests/*",
"*/test_*",
"*/__pycache__/*",
"*/build/*",
"*/dist/*",
"*/vllm.egg-info/*",
"*/third_party/*",
"*/examples/*",
"*/benchmarks/*",
"*/docs/*",
]
[tool.coverage.paths]
# Map all possible vllm locations to a canonical "vllm" path
# This ensures coverage.combine properly merges data from different test runs
source = [
"vllm",
"/vllm-workspace/src/vllm",
"/vllm-workspace/vllm",
"*/site-packages/vllm",
"*/dist-packages/vllm",
]
[tool.coverage.report]
exclude_lines = [
'pragma: no cover',
'def __repr__',
'if self.debug:',
'if settings.DEBUG',
'raise AssertionError',
'raise NotImplementedError',
'if 0:',
'if __name__ == .__main__.:',
'class .*\bProtocol\):',
'@(abc\.)?abstractmethod',
]
[tool.coverage.html]
directory = "htmlcov"
[tool.coverage.xml]
output = "coverage.xml"
[tool.ty.src]
respect-ignore-files = true
+1 -1
View File
@@ -83,7 +83,7 @@ To build the `vllm-rs` in isolation:
```bash
# from the local checkout
./build_rust.sh
./tools/build_rust.sh
```
### Engine-free renderer
@@ -9,7 +9,7 @@ from vllm.utils.import_utils import has_helion
if not has_helion():
pytest.skip("Helion is not installed", allow_module_level=True)
from scripts import benchmark_helion_kernels
from tools import benchmark_helion_kernels
check_correctness = benchmark_helion_kernels.check_correctness
@@ -177,7 +177,7 @@ def test_rust_build_cache_excludes_git_metadata() -> None:
assert "source=.git,target=.git" not in cached_run
assert "source=.git,target=.git" in exact_version_stage
assert 'SETUPTOOLS_SCM_PRETEND_METADATA="{dirty=false}"' in exact_version_stage
assert "bash build_rust.sh" in exact_version_stage
assert "bash tools/build_rust.sh" in exact_version_stage
def test_rocm_ci_base_bake_embeds_content_hash_label() -> None:
@@ -5,19 +5,19 @@
Usage:
# Autotune all registered kernels
python scripts/autotune_helion_kernels.py
python tools/autotune_helion_kernels.py
# Autotune specific kernel
python scripts/autotune_helion_kernels.py --kernels silu_mul_fp8
python tools/autotune_helion_kernels.py --kernels silu_mul_fp8
# Autotune multiple kernels
python scripts/autotune_helion_kernels.py --kernels silu_mul_fp8 rms_norm_fp8
python tools/autotune_helion_kernels.py --kernels silu_mul_fp8 rms_norm_fp8
# Force re-autotuning
python scripts/autotune_helion_kernels.py --force
python tools/autotune_helion_kernels.py --force
# List available kernels
python scripts/autotune_helion_kernels.py --list
python tools/autotune_helion_kernels.py --list
"""
import argparse
@@ -22,25 +22,25 @@ Two baselines are supported (``--baseline``):
Usage:
# List available kernels
python scripts/benchmark_helion_kernels.py --list
python tools/benchmark_helion_kernels.py --list
# Benchmark a kernel against the autotune baseline (default)
python scripts/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant
python tools/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant
# Benchmark against the CUDA baseline
python scripts/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant \\
python tools/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant \\
--baseline cuda
# Check numerics against the performance baseline instead of eager
python scripts/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant \\
python tools/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant \\
--baseline cuda --numerics-with-perf-baseline
# Disable CUDA graph capture and save results
python scripts/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant \\
python tools/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant \\
--no-cudagraph --output results.json
# Only verify numerics, skipping the timing runs
python scripts/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant \\
python tools/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant \\
--numerics-only
"""
+2 -2
View File
@@ -1,13 +1,13 @@
#!/bin/bash
# Build vLLM Rust artifacts and install them into the vllm package.
# Usage: ./build_rust.sh [--debug]
# Usage: ./tools/build_rust.sh [--debug]
#
# By default builds in release mode. Pass --debug for faster compile times
# during development.
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "$0")" && pwd)"
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
# Read the required toolchain from rust-toolchain.toml.
TOOLCHAIN=$(grep '^channel' "$REPO_ROOT/rust-toolchain.toml" | sed 's/.*= *"\(.*\)"/\1/')
+1 -1
View File
@@ -74,7 +74,7 @@ class ConfigSet:
f"If your GPU is a variant of a supported platform, "
f"consider adding a mapping in _GPU_NAME_ALIASES in "
f"vllm/kernels/helion/utils.py, or run "
f"scripts/autotune_helion_kernels.py to generate configs "
f"tools/autotune_helion_kernels.py to generate configs "
f"for your platform."
)
+1 -1
View File
@@ -9,7 +9,7 @@ specific op module it needs, e.g.::
which triggers that op's ``@register_kernel`` as an import side effect.
Tools that need the full registry (e.g. scripts/autotune_helion_kernels.py)
Tools that need the full registry (e.g. tools/autotune_helion_kernels.py)
call ``import_all_ops()`` to force every op module to register.
"""