Skip to content

Commit 8b64c89

Browse files
yangw-devConcurrenseegemini-code-assist[bot]DarkLight1337njhill
authored
[CI] Sync test dependency with test.in for torch nightly (#19632)
Signed-off-by: Yang Wang <elainewy@meta.com> Signed-off-by: Yida Wu <yidawu@alumni.cmu.edu> Signed-off-by: Nick Hill <nhill@redhat.com> Co-authored-by: Concurrensee <yida.wu@amd.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Cyrus Leung <cyrus.tl.leung@gmail.com> Co-authored-by: Nick Hill <nhill@redhat.com>
1 parent 0740e29 commit 8b64c89

File tree

6 files changed

+131
-36
lines changed

6 files changed

+131
-36
lines changed

.buildkite/test-pipeline.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ steps:
4141
# TODO: add `--strict` once warnings in docstrings are fixed
4242
- mkdocs build
4343

44+
- label: Pytorch Nightly Dependency Override Check # 2min
45+
# if this test fails, it means the nightly torch version is not compatible with some
46+
# of the dependencies. Please check the error message and add the package to whitelist
47+
# in /vllm/tools/generate_nightly_torch_test.py
48+
soft_fail: true
49+
source_file_dependencies:
50+
- requirements/nightly_torch_test.txt
51+
commands:
52+
- bash standalone_tests/pytorch_nightly_dependency.sh
53+
4454
- label: Async Engine, Inputs, Utils, Worker Test # 24min
4555
mirror_hardwares: [amdexperimental]
4656
source_file_dependencies:
@@ -767,7 +777,7 @@ steps:
767777
- bash weight_loading/run_model_weight_loading_test.sh -c weight_loading/models.txt
768778

769779
- label: Weight Loading Multiple GPU Test - Large Models # optional
770-
mirror_hardwares: [amdexperimental]
780+
mirror_hardwares: [amdexperimental]
771781
working_dir: "/vllm-workspace/tests"
772782
num_gpus: 2
773783
gpu: a100

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ repos:
5353
files: ^requirements/test\.(in|txt)$
5454
- repo: local
5555
hooks:
56+
- id: format-torch-nightly-test
57+
name: reformat nightly_torch_test.txt to be in sync with test.in
58+
language: python
59+
entry: python tools/generate_nightly_torch_test.py
60+
files: ^requirements/test\.(in|txt)$
5661
- id: mypy-local
5762
name: Run mypy for local Python installation
5863
entry: tools/mypy.sh 0 "local"

requirements/nightly_torch_test.txt

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,50 @@
1-
# Dependency that able to run entrypoints test
2-
# pytest and its extensions
1+
# testing
32
pytest
4-
pytest-asyncio
3+
tensorizer>=2.9.0
54
pytest-forked
6-
pytest-mock
5+
pytest-asyncio
76
pytest-rerunfailures
87
pytest-shard
98
pytest-timeout
109

11-
librosa # required by audio tests in entrypoints/openai
12-
sentence-transformers # required for embedding tests
13-
transformers==4.52.4
14-
transformers_stream_generator # required for qwen-vl test
15-
numba == 0.61.2; python_version > '3.9'
1610
# testing utils
17-
boto3
18-
botocore
19-
datasets
20-
ray >= 2.10.0
11+
backoff # required for phi4mm test
12+
blobfile # required for kimi-vl test
13+
einops # required for MPT, qwen-vl and Mamba
14+
httpx
15+
librosa # required for audio tests
16+
vocos # required for minicpmo_26 test
2117
peft
22-
runai-model-streamer==0.11.0
23-
runai-model-streamer-s3==0.11.0
24-
tensorizer>=2.9.0
25-
lm-eval==0.4.8
26-
buildkite-test-collector==0.1.9
18+
pqdm
19+
ray[cgraph,default]>=2.43.0, !=2.44.* # Ray Compiled Graph, required by pipeline parallelism tests
20+
sentence-transformers # required for embedding tests
21+
soundfile # required for audio tests
22+
jiwer # required for audio tests
23+
timm # required for internvl test
24+
transformers_stream_generator # required for qwen-vl test
25+
matplotlib # required for qwen-vl test
26+
mistral_common[opencv] >= 1.6.2 # required for pixtral test
27+
num2words # required for smolvlm test
28+
opencv-python-headless >= 4.11.0 # required for video test
29+
datamodel_code_generator # required for minicpm3 test
2730
lm-eval[api]==0.4.8 # required for model evaluation test
28-
29-
# required for quantization test
31+
mteb>=1.38.11, <2 # required for mteb test
32+
transformers==4.52.4
33+
tokenizers==0.21.1
34+
huggingface-hub[hf_xet]>=0.30.0 # Required for Xet downloads.
35+
schemathesis>=3.39.15 # Required for openai schema test.
36+
# quantization
3037
bitsandbytes>=0.45.3
38+
buildkite-test-collector==0.1.9
3139

32-
# required for minicpmo_26 test
33-
vector_quantize_pytorch
34-
vocos
35-
36-
# required for Basic Models Test
37-
blobfile # required for kimi-vl test
38-
matplotlib # required for qwen-vl test
3940

40-
# required for Multi-Modal Models Test (Standard)
41-
num2words # required for smolvlm test
42-
pqdm
43-
timm # required for internvl test
44-
mistral-common==1.6.2
41+
genai_perf==0.0.8
42+
tritonclient==2.51.0
4543

46-
schemathesis==3.39.15 # Required for openai schema test.
47-
mteb>=1.38.11, <2 # required for mteb test
44+
numba == 0.60.0; python_version == '3.9' # v0.61 doesn't support Python 3.9. Required for N-gram speculative decoding
45+
numba == 0.61.2; python_version > '3.9'
46+
numpy
47+
runai-model-streamer==0.11.0
48+
runai-model-streamer-s3==0.11.0
49+
fastsafetensors>=0.1.10
50+
pydantic>=2.10 # 2.9 leads to error on python 3.10

requirements/test.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ schemathesis>=3.39.15 # Required for openai schema test.
4242
bitsandbytes>=0.45.3
4343
buildkite-test-collector==0.1.9
4444

45+
4546
genai_perf==0.0.8
4647
tritonclient==2.51.0
4748

@@ -51,4 +52,4 @@ numpy
5152
runai-model-streamer==0.11.0
5253
runai-model-streamer-s3==0.11.0
5354
fastsafetensors>=0.1.10
54-
pydantic>=2.10 # 2.9 leads to error on python 3.10
55+
pydantic>=2.10 # 2.9 leads to error on python 3.10
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/sh
2+
# This script tests if the nightly torch packages are not overridden by the dependencies
3+
4+
set -e
5+
set -x
6+
7+
cd /vllm-workspace/
8+
9+
rm -rf .venv
10+
11+
uv venv .venv
12+
13+
source .venv/bin/activate
14+
15+
# check the environment
16+
uv pip freeze
17+
18+
echo ">>> Installing nightly torch packages"
19+
uv pip install --quiet torch torchvision torchaudio --pre --extra-index-url https://download.pytorch.org/whl/nightly/cu128
20+
21+
echo ">>> Capturing torch-related versions before requirements install"
22+
uv pip freeze | grep -E '^torch|^torchvision|^torchaudio' | sort > before.txt
23+
echo "Before:"
24+
cat before.txt
25+
26+
echo ">>> Installing requirements/nightly_torch_test.txt"
27+
uv pip install --quiet -r requirements/nightly_torch_test.txt
28+
29+
echo ">>> Capturing torch-related versions after requirements install"
30+
uv pip freeze | grep -E '^torch|^torchvision|^torchaudio' | sort > after.txt
31+
echo "After:"
32+
cat after.txt
33+
34+
echo ">>> Comparing versions"
35+
if diff before.txt after.txt; then
36+
echo "torch version not overridden."
37+
else
38+
echo "torch version overridden by nightly_torch_test.txt, \
39+
if the dependency is not triggered by the pytroch nightly test,\
40+
please add the dependency to the list 'white_list' in tools/generate_nightly_torch_test.py"
41+
exit 1
42+
fi

tools/generate_nightly_torch_test.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3+
"""
4+
Generates specialized requirements files for nightly PyTorch testing.
5+
6+
This script reads the main test requirements input file (`requirements/test.in`)
7+
and splits its content into two files:
8+
1. `requirements/nightly_torch_test.txt`: Contains dependencies
9+
except PyTorch-related.
10+
2. `torch_nightly_test.txt`: Contains only PyTorch-related packages.
11+
"""
12+
13+
input_file = "requirements/test.in"
14+
output_file = "requirements/nightly_torch_test.txt"
15+
16+
# white list of packages that are not compatible with PyTorch nightly directly
17+
# with pip install. Please add your package to this list if it is not compatible
18+
# or make the dependency test fails.
19+
white_list = ["torch", "torchaudio", "torchvision", "mamba_ssm"]
20+
21+
with open(input_file) as f:
22+
lines = f.readlines()
23+
24+
skip_next = False
25+
26+
for line in lines:
27+
if skip_next:
28+
if line.startswith((" ", "\t")) or line.strip() == "":
29+
continue
30+
skip_next = False
31+
32+
if any(k in line.lower() for k in white_list):
33+
skip_next = True
34+
continue

0 commit comments

Comments
 (0)