[Refactor] Move auxiliary files out of the repository root (#58572)
Signed-off-by: mgoin <mgoin64@gmail.com>
Misha Goin committed
Sep 24, 2026 at 15:38 UTC
58aa2f1ef1fa993b7178ca454e0807f60e8d3dbc
35 files changed
+134
-130
.buildkite/ci_config_rocm.yaml
+1
-1
@@ -21,7 +21,7 @@ run_all_patterns:
21
- "requirements/test/rocm.txt"
22
- "pyproject.toml"
23
- "setup.py"
24
- - "build_rust.sh"
24
+ - "tools/build_rust.sh"
25
- "rust/"
26
- "rust-toolchain.toml"
27
- "tools/build_rust.py"
.buildkite/scripts/ci-bake-rocm.sh
+1
-1
@@ -23,7 +23,7 @@ DEFAULT_CI_BASE_METADATA_VERSION="3"
23
# local-source stages rather than unreachable remote-fetch alternatives.
24
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"
25
DEFAULT_ROCM_CSRC_DOCKERFILE_STAGES="base fetch_vllm_0 fetch_vllm build_vllm_dependencies rocm-triton-kernels csrc-build"
26
-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"
26
+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"
27
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"
28
# Docker's 128-character tag limit minus the longest cache prefix
29
# ("csrc-rocm-branch-" and "rust-rocm-branch-", both 17 characters).
.buildkite/scripts/hardware_ci/run-gh200-test.sh
+1
-1
@@ -5,7 +5,7 @@
5
set -ex
6
7
# Skip the new torch installation during build since we are using the specified version for arm64 in the Dockerfile
8
-python3 use_existing_torch.py
8
+python3 tools/use_existing_torch.py
9
10
# Try building the docker image
11
DOCKER_BUILDKIT=1 docker build . \
.buildkite/test-amd.yaml
+1
-1
@@ -327,7 +327,7 @@ steps:
327
working_dir: "/vllm-workspace/tests"
328
source_file_dependencies:
329
- vllm/utils/import_utils.py
330
- - scripts/benchmark_helion_kernels.py
330
+ - tools/benchmark_helion_kernels.py
331
- tests/kernels/helion/
332
- vllm/platforms/rocm.py
333
commands:
.buildkite/test_areas/kernels.yaml
+1
-1
@@ -612,7 +612,7 @@ steps:
612
- image-build-amd
613
source_file_dependencies:
614
- vllm/platforms/rocm.py
615
- - scripts/benchmark_helion_kernels.py
615
+ - tools/benchmark_helion_kernels.py
616
617
618
- label: ":nvidia: (H100) FP8 MoE Kernels"
.coveragerc
deleted
-47
@@ -1,47 +0,0 @@
1
-[run]
2
-# Track the installed vllm package (this is what actually gets imported during tests)
3
-# Use wildcard pattern to match the installed location
4
-source =
5
- vllm
6
- */dist-packages/vllm
7
- */site-packages/vllm
8
-omit =
9
- */tests/*
10
- */test_*
11
- */__pycache__/*
12
- */build/*
13
- */dist/*
14
- */vllm.egg-info/*
15
- */third_party/*
16
- */examples/*
17
- */benchmarks/*
18
- */docs/*
19
-
20
-[paths]
21
-# Map all possible vllm locations to a canonical "vllm" path
22
-# This ensures coverage.combine properly merges data from different test runs
23
-source =
24
- vllm
25
- /vllm-workspace/src/vllm
26
- /vllm-workspace/vllm
27
- */site-packages/vllm
28
- */dist-packages/vllm
29
-
30
-[report]
31
-exclude_lines =
32
- pragma: no cover
33
- def __repr__
34
- if self.debug:
35
- if settings.DEBUG
36
- raise AssertionError
37
- raise NotImplementedError
38
- if 0:
39
- if __name__ == .__main__.:
40
- class .*\bProtocol\):
41
- @(abc\.)?abstractmethod
42
-
43
-[html]
44
-directory = htmlcov
45
-
46
-[xml]
47
-output = coverage.xml
.github/CODEOWNERS
+2
-2
@@ -50,7 +50,7 @@
50
# Rust Frontend
51
/rust/ @BugenZhao @njhill
52
/rust/src/bench @esmeetu
53
-/build_rust.sh @BugenZhao @njhill
53
+/tools/build_rust.sh @BugenZhao @njhill
54
/rust-toolchain.toml @BugenZhao @njhill
55
/.buildkite/test_areas/rust* @BugenZhao @njhill
56
@@ -134,7 +134,7 @@
134
mkdocs.yaml @hmellor
135
136
# Linting
137
-.markdownlint.yaml @hmellor
137
+/tools/pre_commit/.markdownlint.yaml @hmellor
138
.pre-commit-config.yaml @hmellor
139
/tools/pre_commit @hmellor
140
.github/CODE_OF_CONDUCT.md
renamed
.github/CONTRIBUTING.md
renamed
.github/codecov.yml
renamed
.pre-commit-config.yaml
+2
-2
@@ -29,7 +29,7 @@ repos:
29
hooks:
30
- id: markdownlint-cli2
31
language_version: lts
32
- args: [--fix]
32
+ args: [--config, tools/pre_commit/.markdownlint.yaml, --fix]
33
exclude: (^|/)CLAUDE\.md$
34
- repo: https://github.com/rhysd/actionlint
35
rev: v1.7.7
@@ -39,7 +39,7 @@ repos:
39
rev: 745eface02aef23e168a8afb6b5737818efbea95 # v0.11.0.1
40
hooks:
41
- id: shellcheck
42
- args: ["-s", "bash", "--format=gcc"]
42
+ args: ["-s", "bash", "--format=gcc", "--rcfile=tools/pre_commit/.shellcheckrc"]
43
- repo: https://github.com/astral-sh/uv-pre-commit
44
rev: 0.11.1
45
hooks:
docker/Dockerfile
+19
-19
@@ -207,7 +207,7 @@ ARG PYTORCH_NIGHTLY
207
# Check whether to install torch nightly instead of release for this build
208
COPY requirements/common.txt requirements/common.txt
209
COPY requirements/cuda.txt requirements/cuda.txt
210
-COPY use_existing_torch.py use_existing_torch.py
210
+COPY tools/use_existing_torch.py tools/use_existing_torch.py
211
COPY pyproject.toml pyproject.toml
212
RUN --mount=type=cache,target=/opt/uv/cache \
213
--mount=type=bind,source=requirements,target=/tmp/vllm-requirements,ro \
@@ -229,7 +229,7 @@ RUN --mount=type=cache,target=/opt/uv/cache \
229
fi \
230
&& if [ "${INSTALL_RUBIN_PRERELEASE}" = "true" ]; then \
231
echo "Installing Rubin prerelease requirements..." \
232
- && /opt/venv/bin/python3 use_existing_torch.py --prefix \
232
+ && /opt/venv/bin/python3 tools/use_existing_torch.py --prefix \
233
&& uv pip install --python /opt/venv/bin/python3 \
234
--prerelease=allow --index-strategy unsafe-first-match \
235
-r /tmp/vllm-requirements/rubin-prerelease.txt \
@@ -243,7 +243,7 @@ RUN --mount=type=cache,target=/opt/uv/cache \
243
&& uv pip install --python /opt/venv/bin/python3 torch torchaudio torchvision --pre \
244
--index-url ${PYTORCH_CUDA_INDEX_BASE_URL}/nightly/cu$(echo $CUDA_VERSION | cut -d. -f1,2 | tr -d '.') \
245
&& echo "Installing other requirements..." \
246
- && /opt/venv/bin/python3 use_existing_torch.py --prefix \
246
+ && /opt/venv/bin/python3 tools/use_existing_torch.py --prefix \
247
&& uv pip install --python /opt/venv/bin/python3 -r requirements/cuda.txt \
248
--extra-index-url ${PYTORCH_CUDA_INDEX_BASE_URL}/nightly/cu$(echo $CUDA_VERSION | cut -d. -f1,2 | tr -d '.'); \
249
else \
@@ -316,12 +316,12 @@ COPY requirements/build/rust.txt requirements/build/rust.txt
316
RUN --mount=type=cache,target=/opt/uv/cache \
317
uv pip install --python /opt/venv/bin/python3 -r requirements/build/rust.txt
318
319
-# Copy only the Rust build inputs; build_rust.sh publishes artifacts needed
319
+# Copy only the Rust build inputs; tools/build_rust.sh publishes artifacts needed
320
# by the wheel build stage.
321
COPY rust rust
322
COPY rust-toolchain.toml rust-toolchain.toml
323
COPY tools/build_rust.py tools/build_rust.py
324
-COPY build_rust.sh build_rust.sh
324
+COPY tools/build_rust.sh tools/build_rust.sh
325
326
# Cap cargo parallelism to avoid exhausting the CI host's open-file limit
327
# (rustc spawns enough concurrent processes to hit RLIMIT_NOFILE otherwise).
@@ -341,7 +341,7 @@ RUN --mount=type=cache,target=/root/.cargo/registry,sharing=locked \
341
export RUSTC_WRAPPER=sccache; \
342
sccache --show-stats; \
343
fi \
344
- && SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0+docker.cache" bash build_rust.sh \
344
+ && SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0+docker.cache" bash tools/build_rust.sh \
345
&& if [ "$USE_SCCACHE" = "1" ]; then \
346
sccache --show-stats; \
347
fi
@@ -352,7 +352,7 @@ FROM rust-build-cache AS rust-build
352
RUN --mount=type=cache,target=/root/.cargo/registry,sharing=locked \
353
--mount=type=cache,target=/root/.cargo/git,sharing=locked \
354
--mount=type=bind,source=.git,target=.git \
355
- SETUPTOOLS_SCM_PRETEND_METADATA="{dirty=false}" bash build_rust.sh
355
+ SETUPTOOLS_SCM_PRETEND_METADATA="{dirty=false}" bash tools/build_rust.sh
356
#################### RUST BUILD IMAGE ####################
357
358
#################### CSRC BUILD IMAGE ####################
@@ -368,7 +368,7 @@ ARG PYTORCH_NIGHTLY
368
369
# Install build dependencies
370
COPY requirements/build/cuda.txt requirements/build/cuda.txt
371
-COPY use_existing_torch.py use_existing_torch.py
371
+COPY tools/use_existing_torch.py tools/use_existing_torch.py
372
COPY --from=base /workspace/torch_lib_versions.txt torch_lib_versions.txt
373
374
# 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
381
RUN --mount=type=cache,target=/opt/uv/cache \
382
if [ "${INSTALL_RUBIN_PRERELEASE}" = "true" ]; then \
383
echo "Installing build requirements with Rubin prerelease PyTorch..." \
384
- && python3 use_existing_torch.py --prefix \
384
+ && python3 tools/use_existing_torch.py --prefix \
385
&& uv pip install --python /opt/venv/bin/python3 -r requirements/build/cuda.txt; \
386
elif [ "${PYTORCH_NIGHTLY}" = "1" ]; then \
387
echo "Installing build requirements without torch..." \
388
- && python3 use_existing_torch.py --prefix \
388
+ && python3 tools/use_existing_torch.py --prefix \
389
&& uv pip install --python /opt/venv/bin/python3 -r requirements/build/cuda.txt \
390
&& echo "Installing torch nightly..." \
391
&& 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"
427
RUN --mount=type=cache,target=/opt/uv/cache \
428
if [ "${PYTORCH_NIGHTLY}" = "1" ] || \
429
[ "${INSTALL_RUBIN_PRERELEASE}" = "true" ]; then \
430
- python3 use_existing_torch.py --prefix; \
430
+ python3 tools/use_existing_torch.py --prefix; \
431
fi
432
433
# Provision one bare Python per `requires-python` entry; cmake reads
@@ -605,7 +605,7 @@ ARG PYTORCH_NIGHTLY
605
606
# Install build dependencies
607
COPY requirements/build/cuda.txt requirements/build/cuda.txt
608
-COPY use_existing_torch.py use_existing_torch.py
608
+COPY tools/use_existing_torch.py tools/use_existing_torch.py
609
COPY --from=base /workspace/torch_lib_versions.txt torch_lib_versions.txt
610
611
# 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
618
RUN --mount=type=cache,target=/opt/uv/cache \
619
if [ "${INSTALL_RUBIN_PRERELEASE}" = "true" ]; then \
620
echo "Installing build requirements with Rubin prerelease PyTorch..." \
621
- && python3 use_existing_torch.py --prefix \
621
+ && python3 tools/use_existing_torch.py --prefix \
622
&& uv pip install --python /opt/venv/bin/python3 -r requirements/build/cuda.txt; \
623
elif [ "${PYTORCH_NIGHTLY}" = "1" ]; then \
624
echo "Installing build requirements without torch..." \
625
- && python3 use_existing_torch.py --prefix \
625
+ && python3 tools/use_existing_torch.py --prefix \
626
&& uv pip install --python /opt/venv/bin/python3 -r requirements/build/cuda.txt \
627
&& echo "Installing torch nightly..." \
628
&& 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
658
RUN --mount=type=cache,target=/opt/uv/cache \
659
if [ "${PYTORCH_NIGHTLY}" = "1" ] || \
660
[ "${INSTALL_RUBIN_PRERELEASE}" = "true" ]; then \
661
- python3 use_existing_torch.py --prefix; \
661
+ python3 tools/use_existing_torch.py --prefix; \
662
fi \
663
&& if [ "${INSTALL_RUBIN_PRERELEASE}" = "true" ]; then \
664
sed -Ei '/^[[:space:]]*(flashinfer-python|nvidia-cutlass-dsl\[cu13\]|quack-kernels)[[:space:]]*==/Id' \
@@ -729,12 +729,12 @@ COPY requirements/lint.txt requirements/lint.txt
729
COPY requirements/test/cuda.in requirements/test/cuda.in
730
COPY requirements/test/cuda.txt requirements/test/cuda.txt
731
COPY requirements/dev.txt requirements/dev.txt
732
-COPY use_existing_torch.py use_existing_torch.py
732
+COPY tools/use_existing_torch.py tools/use_existing_torch.py
733
COPY --from=base /workspace/torch_lib_versions.txt torch_lib_versions.txt
734
RUN --mount=type=cache,target=/opt/uv/cache \
735
if [ "${PYTORCH_NIGHTLY}" = "1" ]; then \
736
echo "Installing dev requirements plus torch nightly..." \
737
- && python3 use_existing_torch.py --prefix \
737
+ && python3 tools/use_existing_torch.py --prefix \
738
&& cat torch_lib_versions.txt >> requirements/test/cuda.in \
739
&& uv pip compile requirements/test/cuda.in -o requirements/test/cuda.txt --index-strategy unsafe-best-match \
740
--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
1143
COPY requirements/test/cuda.in requirements/test/cuda.in
1144
COPY requirements/test/cuda.txt requirements/test/cuda.txt
1145
COPY requirements/dev.txt requirements/dev.txt
1146
-COPY use_existing_torch.py use_existing_torch.py
1146
+COPY tools/use_existing_torch.py tools/use_existing_torch.py
1147
COPY --from=base /workspace/torch_lib_versions.txt torch_lib_versions.txt
1148
RUN --mount=type=cache,target=/opt/uv/cache \
1149
CUDA_MAJOR="${CUDA_VERSION%%.*}"; \
1150
if [ "$CUDA_MAJOR" -ge 12 ]; then \
1151
if [ "${PYTORCH_NIGHTLY}" = "1" ]; then \
1152
echo "Installing dev requirements plus torch nightly..." \
1153
- && python3 use_existing_torch.py --prefix \
1153
+ && python3 tools/use_existing_torch.py --prefix \
1154
&& cat torch_lib_versions.txt >> requirements/test/cuda.in \
1155
&& uv pip compile requirements/test/cuda.in -o requirements/test/cuda.txt --index-strategy unsafe-best-match \
1156
--extra-index-url ${PYTORCH_CUDA_INDEX_BASE_URL}/nightly/cu$(echo $CUDA_VERSION | cut -d. -f1,2 | tr -d '.') \
docker/Dockerfile.cpu
+11
-11
@@ -119,10 +119,10 @@ ARG PYTORCH_CPU_INDEX_BASE_URL=https://download.pytorch.org/whl
119
# Copy requirements files for installation
120
COPY requirements/common.txt requirements/common.txt
121
COPY requirements/cpu.txt requirements/cpu.txt
122
-COPY use_existing_torch.py use_existing_torch.py
122
+COPY tools/use_existing_torch.py tools/use_existing_torch.py
123
124
# For nightly: install torch nightly (CPU) first, strip torch pins from the
125
-# requirements via use_existing_torch.py so they can't pull it back to a release
125
+# requirements via tools/use_existing_torch.py so they can't pull it back to a release
126
# build, then install the rest from the nightly CPU index (no --torch-backend,
127
# which would force the stable channel). Release path is unchanged.
128
RUN --mount=type=cache,target=/root/.cache/uv \
@@ -131,7 +131,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
131
echo "Installing torch nightly (CPU)..." \
132
&& uv pip install torch torchaudio torchvision torchcodec --pre \
133
--index-url ${PYTORCH_CPU_INDEX_BASE_URL}/nightly/cpu \
134
- && python3 use_existing_torch.py --prefix \
134
+ && python3 tools/use_existing_torch.py --prefix \
135
&& uv pip install -r requirements/cpu.txt \
136
--extra-index-url ${PYTORCH_CPU_INDEX_BASE_URL}/nightly/cpu; \
137
else \
@@ -183,12 +183,12 @@ ENV SCCACHE_REGION=${USE_SCCACHE:+${SCCACHE_REGION_NAME}}
183
# Avoid port collision with vllm-build's own sccache daemon.
184
ENV SCCACHE_SERVER_PORT=4227
185
186
-# Copy only the Rust build inputs; build_rust.sh publishes artifacts needed
186
+# Copy only the Rust build inputs; tools/build_rust.sh publishes artifacts needed
187
# by the wheel build stage.
188
COPY rust rust
189
COPY rust-toolchain.toml rust-toolchain.toml
190
COPY tools/build_rust.py tools/build_rust.py
191
-COPY build_rust.sh build_rust.sh
191
+COPY tools/build_rust.sh tools/build_rust.sh
192
193
# Cap cargo parallelism to avoid exhausting the CI host's open-file limit
194
# (rustc spawns enough concurrent processes to hit RLIMIT_NOFILE otherwise).
@@ -210,10 +210,10 @@ RUN --mount=type=cache,target=/root/.cargo/registry,sharing=locked \
210
fi; \
211
sccache --show-stats; \
212
fi && \
213
- SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0+docker.cache" bash build_rust.sh && \
213
+ SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0+docker.cache" bash tools/build_rust.sh && \
214
if [ "$USE_SCCACHE" = "1" ]; then sccache --show-stats; fi
215
216
-# build_rust.sh installed rustup here via rustup.rs; put it on PATH so the
216
+# tools/build_rust.sh installed rustup here via rustup.rs; put it on PATH so the
217
# child stage below finds it on disk instead of re-downloading it.
218
ENV PATH="/root/.cargo/bin:${PATH}"
219
@@ -223,7 +223,7 @@ FROM rust-build-cache AS rust-build
223
RUN --mount=type=cache,target=/root/.cargo/registry,sharing=locked \
224
--mount=type=cache,target=/root/.cargo/git,sharing=locked \
225
--mount=type=bind,source=.git,target=.git \
226
- SETUPTOOLS_SCM_PRETEND_METADATA="{dirty=false}" bash build_rust.sh
226
+ SETUPTOOLS_SCM_PRETEND_METADATA="{dirty=false}" bash tools/build_rust.sh
227
228
######################### SOURCE PREP IMAGE #########################
229
# 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
262
263
RUN --mount=type=cache,target=/root/.cache/uv \
264
if [ "${PYTORCH_NIGHTLY}" = "1" ]; then \
265
- python3 /workspace/use_existing_torch.py --prefix \
265
+ python3 /workspace/tools/use_existing_torch.py --prefix \
266
&& uv pip install -r requirements/build/cpu.txt \
267
--extra-index-url ${PYTORCH_CPU_INDEX_BASE_URL}/nightly/cpu; \
268
else \
@@ -287,7 +287,7 @@ RUN if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh ; fi
287
# now-unpinned dependency. Done at the end of vllm-src so vllm-build and
288
# vllm-dev, which both derive from it, inherit the unpinned tree.
289
RUN if [ "${PYTORCH_NIGHTLY}" = "1" ]; then \
290
- python3 /workspace/use_existing_torch.py --prefix; \
290
+ python3 /workspace/tools/use_existing_torch.py --prefix; \
291
fi
292
293
######################### BUILD IMAGE #########################
@@ -343,7 +343,7 @@ RUN case "$(uname -m)" in \
343
RUN --mount=type=cache,target=/root/.cache/uv \
344
export CFLAGS="${CFLAGS:+${CFLAGS} }-std=gnu17" && \
345
if [ "${PYTORCH_NIGHTLY}" = "1" ]; then \
346
- python3 /workspace/use_existing_torch.py --prefix \
346
+ python3 /workspace/tools/use_existing_torch.py --prefix \
347
&& uv pip install -r requirements/test/cpu.txt \
348
--extra-index-url ${PYTORCH_CPU_INDEX_BASE_URL}/nightly/cpu; \
349
else \
docker/Dockerfile.ppc64le
+2
-2
@@ -36,10 +36,10 @@ COPY pyproject.toml ./
36
37
# The script is expected to install whatever python dependencies are missing
38
# as well as whatever system libraries need to be installed from source
39
-COPY build_vllm_*.sh ./
39
+COPY docker/build_vllm_*.sh docker/
40
41
RUN --mount=type=cache,target=/root/.cache/uv \
42
- sh ./build_vllm_$(uname -m).sh
42
+ sh ./docker/build_vllm_$(uname -m).sh
43
44
# copy vllm source code to build cache
45
COPY . .
docker/Dockerfile.rock
+6
-6
@@ -171,7 +171,7 @@ COPY rust/proto /rust-input/vllm/rust/proto
171
COPY rust/src /rust-input/vllm/rust/src
172
COPY rust-toolchain.toml /rust-input/vllm/rust-toolchain.toml
173
COPY tools/build_rust.py /rust-input/vllm/tools/build_rust.py
174
-COPY build_rust.sh /rust-input/vllm/build_rust.sh
174
+COPY tools/build_rust.sh /rust-input/vllm/tools/build_rust.sh
175
176
FROM base AS rust_input_1
177
ARG VLLM_REPO
@@ -188,7 +188,7 @@ RUN git clone --no-checkout --filter=blob:none ${VLLM_REPO} /rust-input/vllm \
188
rust/src/** \
189
rust-toolchain.toml \
190
tools/build_rust.py \
191
- build_rust.sh \
191
+ tools/build_rust.sh \
192
&& git checkout FETCH_HEAD
193
194
FROM rust_input_${REMOTE_VLLM} AS rust-input
@@ -244,7 +244,7 @@ RUN --mount=type=cache,id=vllm-rocm-uv,target=/root/.cache/uv \
244
COPY --from=rust-input /rust-input/vllm/rust rust
245
COPY --from=rust-input /rust-input/vllm/rust-toolchain.toml rust-toolchain.toml
246
COPY --from=rust-input /rust-input/vllm/tools/build_rust.py tools/build_rust.py
247
-COPY --from=rust-input /rust-input/vllm/build_rust.sh build_rust.sh
247
+COPY --from=rust-input /rust-input/vllm/tools/build_rust.sh tools/build_rust.sh
248
COPY --from=vllm-version /vllm-version.txt /tmp/vllm-version.txt
249
250
# 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,
258
&& sccache --show-stats; \
259
fi \
260
&& export SETUPTOOLS_SCM_PRETEND_VERSION="$(cat /tmp/vllm-version.txt)" \
261
- && bash build_rust.sh \
261
+ && bash tools/build_rust.sh \
262
&& test -x vllm/vllm-rs \
263
&& if [ "$USE_SCCACHE" = "1" ]; then \
264
sccache --show-stats; \
@@ -368,7 +368,7 @@ COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/requirements /requirements
368
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/benchmarks /benchmarks
369
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/tests /tests
370
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/examples /examples
371
-COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/scripts/benchmark_helion_kernels.py /scripts/benchmark_helion_kernels.py
371
+COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/tools/benchmark_helion_kernels.py /tools/benchmark_helion_kernels.py
372
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/tools/install_torchcodec_rocm.sh /tools/install_torchcodec_rocm.sh
373
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/docker/Dockerfile /docker/Dockerfile
374
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
729
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/benchmarks /benchmarks
730
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/tests /tests
731
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/examples /examples
732
-COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/scripts/benchmark_helion_kernels.py /scripts/benchmark_helion_kernels.py
732
+COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/tools/benchmark_helion_kernels.py /tools/benchmark_helion_kernels.py
733
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/tools/install_torchcodec_rocm.sh /tools/install_torchcodec_rocm.sh
734
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/docker/Dockerfile /docker/Dockerfile
735
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/docker/Dockerfile.cpu /docker/Dockerfile.cpu
docker/Dockerfile.rocm
+4
-6
@@ -171,7 +171,7 @@ COPY rust/proto /rust-input/vllm/rust/proto
171
COPY rust/src /rust-input/vllm/rust/src
172
COPY rust-toolchain.toml /rust-input/vllm/rust-toolchain.toml
173
COPY tools/build_rust.py /rust-input/vllm/tools/build_rust.py
174
-COPY build_rust.sh /rust-input/vllm/build_rust.sh
174
+COPY tools/build_rust.sh /rust-input/vllm/tools/build_rust.sh
175
176
FROM base AS rust_input_1
177
ARG VLLM_REPO
@@ -188,7 +188,7 @@ RUN git clone --no-checkout --filter=blob:none ${VLLM_REPO} /rust-input/vllm \
188
rust/src/** \
189
rust-toolchain.toml \
190
tools/build_rust.py \
191
- build_rust.sh \
191
+ tools/build_rust.sh \
192
&& git checkout FETCH_HEAD
193
194
FROM rust_input_${REMOTE_VLLM} AS rust-input
@@ -244,7 +244,7 @@ RUN --mount=type=cache,id=vllm-rocm-uv,target=/root/.cache/uv \
244
COPY --from=rust-input /rust-input/vllm/rust rust
245
COPY --from=rust-input /rust-input/vllm/rust-toolchain.toml rust-toolchain.toml
246
COPY --from=rust-input /rust-input/vllm/tools/build_rust.py tools/build_rust.py
247
-COPY --from=rust-input /rust-input/vllm/build_rust.sh build_rust.sh
247
+COPY --from=rust-input /rust-input/vllm/tools/build_rust.sh tools/build_rust.sh
248
COPY --from=vllm-version /vllm-version.txt /tmp/vllm-version.txt
249
250
# 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,
258
&& sccache --show-stats; \
259
fi \
260
&& export SETUPTOOLS_SCM_PRETEND_VERSION="$(cat /tmp/vllm-version.txt)" \
261
- && bash build_rust.sh \
261
+ && bash tools/build_rust.sh \
262
&& test -x vllm/vllm-rs \
263
&& if [ "$USE_SCCACHE" = "1" ]; then \
264
sccache --show-stats; \
@@ -366,7 +366,6 @@ COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/requirements /requirements
366
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/benchmarks /benchmarks
367
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/tests /tests
368
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/examples /examples
369
-COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/scripts/benchmark_helion_kernels.py /scripts/benchmark_helion_kernels.py
369
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/tools /tools
370
COPY --from=build_vllm ${COMMON_WORKDIR}/vllm/docker/Dockerfile /docker/Dockerfile
371
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
748
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/benchmarks /benchmarks
749
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/tests /tests
750
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/examples /examples
752
-COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/scripts/benchmark_helion_kernels.py /scripts/benchmark_helion_kernels.py
751
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/tools /tools
752
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/docker/Dockerfile /docker/Dockerfile
753
COPY --from=build_vllm_wheel_release ${COMMON_WORKDIR}/vllm/docker/Dockerfile.cpu /docker/Dockerfile.cpu
docker/Dockerfile.rocm_gfx1250
+1
-1
@@ -166,7 +166,7 @@ RUN --mount=type=cache,id=vllm-rocm-cargo-registry,target=/root/.cargo/registry,
166
--mount=type=cache,id=vllm-rocm-cargo-git,target=/root/.cargo/git,sharing=locked \
167
cd ${COMMON_WORKDIR}/vllm \
168
&& export SETUPTOOLS_SCM_PRETEND_VERSION="$(cat /tmp/vllm-version.txt)" \
169
- && bash build_rust.sh \
169
+ && bash tools/build_rust.sh \
170
&& test -x vllm/vllm-rs
171
172
# -----------------------
docker/Dockerfile.xpu
+4
-4
@@ -14,12 +14,12 @@ WORKDIR /workspace
14
COPY requirements/build/rust.txt requirements/build/rust.txt
15
RUN python3 -m pip install --no-cache-dir -r requirements/build/rust.txt
16
17
-# Copy only the Rust build inputs; build_rust.sh publishes artifacts needed
17
+# Copy only the Rust build inputs; tools/build_rust.sh publishes artifacts needed
18
# by the wheel build stage.
19
COPY rust rust
20
COPY rust-toolchain.toml rust-toolchain.toml
21
COPY tools/build_rust.py tools/build_rust.py
22
-COPY build_rust.sh build_rust.sh
22
+COPY tools/build_rust.sh tools/build_rust.sh
23
24
# Cap cargo parallelism to avoid exhausting the CI host's open-file limit
25
# (rustc spawns enough concurrent processes to hit RLIMIT_NOFILE otherwise).
@@ -29,7 +29,7 @@ ENV CARGO_BUILD_JOBS=4
29
# inputs. The child stage below relinks the crates that embed the exact version.
30
RUN --mount=type=cache,target=/root/.cargo/registry,sharing=locked \
31
--mount=type=cache,target=/root/.cargo/git,sharing=locked \
32
- SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0+docker.cache" bash build_rust.sh
32
+ SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0+docker.cache" bash tools/build_rust.sh
33
34
# Relink with the exact Git-derived package version.
35
FROM rust-build-cache AS rust-build
@@ -37,7 +37,7 @@ FROM rust-build-cache AS rust-build
37
RUN --mount=type=cache,target=/root/.cargo/registry,sharing=locked \
38
--mount=type=cache,target=/root/.cargo/git,sharing=locked \
39
--mount=type=bind,source=.git,target=.git \
40
- SETUPTOOLS_SCM_PRETEND_METADATA="{dirty=false}" bash build_rust.sh
40
+ SETUPTOOLS_SCM_PRETEND_METADATA="{dirty=false}" bash tools/build_rust.sh
41
42
FROM ubuntu:24.04 AS vllm-base
43
docker/build_vllm_ppc64le.sh
renamed
docs/contributing/README.md
+7
-2
@@ -46,8 +46,8 @@ VLLM_USE_PRECOMPILED=1 uv pip install -e .
46
To rebuild only the Rust frontend binary:
47
48
```bash
49
-./build_rust.sh # release build
50
-./build_rust.sh --debug # faster build for development
49
+./tools/build_rust.sh # release build
50
+./tools/build_rust.sh --debug # faster build for development
51
```
52
53
If you are developing vLLM's Python and CUDA/C++ code, install PyTorch first:
@@ -89,6 +89,11 @@ pre-commit install
89
90
vLLM's `pre-commit` hooks will now run automatically every time you commit.
91
92
+When running ShellCheck or markdownlint directly, or configuring an editor
93
+integration, use the configuration files in `tools/pre_commit/`:
94
+`--rcfile=tools/pre_commit/.shellcheckrc` for ShellCheck and
95
+`--config tools/pre_commit/.markdownlint.yaml` for markdownlint-cli2.
96
+
97
!!! tip "Tips"
98
You can manually run the `pre-commit` hooks using:
99
docs/contributing/release_process.md
renamed
docs/getting_started/installation/gpu.cuda.inc.md
+3
-3
@@ -111,8 +111,8 @@ This command will do the following:
111
If you need to recompile the `vllm-rs` Rust frontend binary, you can rebuild and install it without re-running the full pip install:
112
113
```bash
114
- ./build_rust.sh # release build
115
- ./build_rust.sh --debug # faster build for development
114
+ ./tools/build_rust.sh # release build
115
+ ./tools/build_rust.sh --debug # faster build for development
116
```
117
118
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:
183
# install PyTorch first, either from PyPI or from source
184
git clone https://github.com/vllm-project/vllm.git
185
cd vllm
186
-python use_existing_torch.py
186
+python tools/use_existing_torch.py
187
uv pip install -r requirements/build/cuda.txt
188
uv pip install --no-build-isolation -e .
189
```
docs/getting_started/installation/gpu.rocm.inc.md
+2
-2
@@ -187,8 +187,8 @@ If you need to recompile the `vllm-rs` Rust frontend binary, you can rebuild and
187
install it without re-running the full installation:
188
189
```bash
190
- ./build_rust.sh # release build
191
- ./build_rust.sh --debug # faster build for development
190
+ ./tools/build_rust.sh # release build
191
+ ./tools/build_rust.sh --debug # faster build for development
192
```
193
194
This will install the required Rust toolchain if needed, build the binary,
pyproject.toml
+48
@@ -130,6 +130,54 @@ markers = [
130
"optional: optional tests that are automatically skipped, include --optional to run them",
131
]
132
133
+[tool.coverage.run]
134
+# Track the installed vllm package (this is what actually gets imported during tests)
135
+# Use wildcard pattern to match the installed location
136
+source = ["vllm", "*/dist-packages/vllm", "*/site-packages/vllm"]
137
+omit = [
138
+ "*/tests/*",
139
+ "*/test_*",
140
+ "*/__pycache__/*",
141
+ "*/build/*",
142
+ "*/dist/*",
143
+ "*/vllm.egg-info/*",
144
+ "*/third_party/*",
145
+ "*/examples/*",
146
+ "*/benchmarks/*",
147
+ "*/docs/*",
148
+]
149
+
150
+[tool.coverage.paths]
151
+# Map all possible vllm locations to a canonical "vllm" path
152
+# This ensures coverage.combine properly merges data from different test runs
153
+source = [
154
+ "vllm",
155
+ "/vllm-workspace/src/vllm",
156
+ "/vllm-workspace/vllm",
157
+ "*/site-packages/vllm",
158
+ "*/dist-packages/vllm",
159
+]
160
+
161
+[tool.coverage.report]
162
+exclude_lines = [
163
+ 'pragma: no cover',
164
+ 'def __repr__',
165
+ 'if self.debug:',
166
+ 'if settings.DEBUG',
167
+ 'raise AssertionError',
168
+ 'raise NotImplementedError',
169
+ 'if 0:',
170
+ 'if __name__ == .__main__.:',
171
+ 'class .*\bProtocol\):',
172
+ '@(abc\.)?abstractmethod',
173
+]
174
+
175
+[tool.coverage.html]
176
+directory = "htmlcov"
177
+
178
+[tool.coverage.xml]
179
+output = "coverage.xml"
180
+
181
[tool.ty.src]
182
respect-ignore-files = true
183
rust/README.md
+1
-1
@@ -83,7 +83,7 @@ To build the `vllm-rs` in isolation:
83
84
```bash
85
# from the local checkout
86
-./build_rust.sh
86
+./tools/build_rust.sh
87
```
88
89
### Engine-free renderer
tests/kernels/helion/test_benchmark_script.py
+1
-1
@@ -9,7 +9,7 @@ from vllm.utils.import_utils import has_helion
9
if not has_helion():
10
pytest.skip("Helion is not installed", allow_module_level=True)
11
12
-from scripts import benchmark_helion_kernels
12
+from tools import benchmark_helion_kernels
13
14
check_correctness = benchmark_helion_kernels.check_correctness
15
tests/tools/test_docker_build_metadata_args.py
+1
-1
@@ -177,7 +177,7 @@ def test_rust_build_cache_excludes_git_metadata() -> None:
177
assert "source=.git,target=.git" not in cached_run
178
assert "source=.git,target=.git" in exact_version_stage
179
assert 'SETUPTOOLS_SCM_PRETEND_METADATA="{dirty=false}"' in exact_version_stage
180
- assert "bash build_rust.sh" in exact_version_stage
180
+ assert "bash tools/build_rust.sh" in exact_version_stage
181
182
183
def test_rocm_ci_base_bake_embeds_content_hash_label() -> None:
tools/autotune_helion_kernels.py
renamed
+5
-5
@@ -5,19 +5,19 @@
5
6
Usage:
7
# Autotune all registered kernels
8
- python scripts/autotune_helion_kernels.py
8
+ python tools/autotune_helion_kernels.py
9
10
# Autotune specific kernel
11
- python scripts/autotune_helion_kernels.py --kernels silu_mul_fp8
11
+ python tools/autotune_helion_kernels.py --kernels silu_mul_fp8
12
13
# Autotune multiple kernels
14
- python scripts/autotune_helion_kernels.py --kernels silu_mul_fp8 rms_norm_fp8
14
+ python tools/autotune_helion_kernels.py --kernels silu_mul_fp8 rms_norm_fp8
15
16
# Force re-autotuning
17
- python scripts/autotune_helion_kernels.py --force
17
+ python tools/autotune_helion_kernels.py --force
18
19
# List available kernels
20
- python scripts/autotune_helion_kernels.py --list
20
+ python tools/autotune_helion_kernels.py --list
21
"""
22
23
import argparse
tools/benchmark_helion_kernels.py
renamed
+6
-6
@@ -22,25 +22,25 @@ Two baselines are supported (``--baseline``):
22
23
Usage:
24
# List available kernels
25
- python scripts/benchmark_helion_kernels.py --list
25
+ python tools/benchmark_helion_kernels.py --list
26
27
# Benchmark a kernel against the autotune baseline (default)
28
- python scripts/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant
28
+ python tools/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant
29
30
# Benchmark against the CUDA baseline
31
- python scripts/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant \\
31
+ python tools/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant \\
32
--baseline cuda
33
34
# Check numerics against the performance baseline instead of eager
35
- python scripts/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant \\
35
+ python tools/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant \\
36
--baseline cuda --numerics-with-perf-baseline
37
38
# Disable CUDA graph capture and save results
39
- python scripts/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant \\
39
+ python tools/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant \\
40
--no-cudagraph --output results.json
41
42
# Only verify numerics, skipping the timing runs
43
- python scripts/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant \\
43
+ python tools/benchmark_helion_kernels.py --kernel per_token_group_fp8_quant \\
44
--numerics-only
45
"""
46
tools/build_rust.sh
renamed
+2
-2
@@ -1,13 +1,13 @@
1
#!/bin/bash
2
# Build vLLM Rust artifacts and install them into the vllm package.
3
-# Usage: ./build_rust.sh [--debug]
3
+# Usage: ./tools/build_rust.sh [--debug]
4
#
5
# By default builds in release mode. Pass --debug for faster compile times
6
# during development.
7
8
set -euo pipefail
9
10
-REPO_ROOT="$(cd "$(dirname "$0")" && pwd)"
10
+REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
11
12
# Read the required toolchain from rust-toolchain.toml.
13
TOOLCHAIN=$(grep '^channel' "$REPO_ROOT/rust-toolchain.toml" | sed 's/.*= *"\(.*\)"/\1/')
tools/pre_commit/.markdownlint.yaml
renamed
tools/pre_commit/.shellcheckrc
renamed
tools/use_existing_torch.py
renamed
vllm/kernels/helion/config_manager.py
+1
-1
@@ -74,7 +74,7 @@ class ConfigSet:
74
f"If your GPU is a variant of a supported platform, "
75
f"consider adding a mapping in _GPU_NAME_ALIASES in "
76
f"vllm/kernels/helion/utils.py, or run "
77
- f"scripts/autotune_helion_kernels.py to generate configs "
77
+ f"tools/autotune_helion_kernels.py to generate configs "
78
f"for your platform."
79
)
80
vllm/kernels/helion/ops/__init__.py
+1
-1
@@ -9,7 +9,7 @@ specific op module it needs, e.g.::
9
10
which triggers that op's ``@register_kernel`` as an import side effect.
11
12
-Tools that need the full registry (e.g. scripts/autotune_helion_kernels.py)
12
+Tools that need the full registry (e.g. tools/autotune_helion_kernels.py)
13
call ``import_all_ops()`` to force every op module to register.
14
"""
15