From 249aab629f308c691ab1a192070ceeac1cd6f945 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Fri, 13 Jun 2025 18:33:59 -0700 Subject: [PATCH 01/21] final Signed-off-by: Yang Wang --- .pre-commit-config.yaml | 6 +++ requirements/nightly_torch_test.txt | 71 +++++++++++++++------------- requirements/test.in | 5 +- tools/generate_nightly_torch_test.py | 47 ++++++++++++++++++ torch_nightly_test.txt | 2 + 5 files changed, 93 insertions(+), 38 deletions(-) create mode 100644 tools/generate_nightly_torch_test.py create mode 100644 torch_nightly_test.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7534ae55907e..43efa139c74c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -53,6 +53,12 @@ repos: files: ^requirements/test\.(in|txt)$ - repo: local hooks: + - id: format-torch-nightly-test + name: reformat nightly_torch_test.txt to be in sync with test.in + language: python + entry: python tools/generate_nightly_torch_test.py + files: ^requirements/test\.(in|txt)$ + types: [python] - id: mypy-local name: Run mypy for local Python installation entry: tools/mypy.sh 0 "local" diff --git a/requirements/nightly_torch_test.txt b/requirements/nightly_torch_test.txt index 17909dee3503..3a961fcc423b 100644 --- a/requirements/nightly_torch_test.txt +++ b/requirements/nightly_torch_test.txt @@ -1,46 +1,49 @@ -# Dependency that able to run entrypoints test -# pytest and its extensions +# testing pytest -pytest-asyncio +tensorizer>=2.9.0 pytest-forked -pytest-mock +pytest-asyncio pytest-rerunfailures pytest-shard pytest-timeout -librosa # required by audio tests in entrypoints/openai -sentence-transformers # required for embedding tests -transformers==4.52.4 -transformers_stream_generator # required for qwen-vl test -numba == 0.61.2; python_version > '3.9' # testing utils -boto3 -botocore -datasets -ray >= 2.10.0 +backoff # required for phi4mm test +blobfile # required for kimi-vl test +einops # required for MPT, qwen-vl and Mamba +httpx +librosa # required for audio tests +vocos # required for minicpmo_26 test peft -runai-model-streamer==0.11.0 -runai-model-streamer-s3==0.11.0 -tensorizer>=2.9.0 -lm-eval==0.4.8 -buildkite-test-collector==0.1.9 +pqdm +ray[cgraph,default]>=2.43.0, !=2.44.* # Ray Compiled Graph, required by pipeline parallelism tests +sentence-transformers # required for embedding tests +soundfile # required for audio tests +jiwer # required for audio tests +timm # required for internvl test +transformers_stream_generator # required for qwen-vl test +matplotlib # required for qwen-vl test +mistral_common[opencv] >= 1.6.2 # required for pixtral test +num2words # required for smolvlm test +opencv-python-headless >= 4.11.0 # required for video test +datamodel_code_generator # required for minicpm3 test lm-eval[api]==0.4.8 # required for model evaluation test - -# required for quantization test +mteb>=1.38.11, <2 # required for mteb test +transformers==4.52.4 +tokenizers==0.21.1 +huggingface-hub[hf_xet]>=0.30.0 # Required for Xet downloads. +schemathesis>=3.39.15 # Required for openai schema test. +# quantization bitsandbytes>=0.45.3 +buildkite-test-collector==0.1.9 -# required for minicpmo_26 test -vector_quantize_pytorch -vocos - -# required for Basic Models Test -blobfile # required for kimi-vl test -matplotlib # required for qwen-vl test - -# required for Multi-Modal Models Test (Standard) -num2words # required for smolvlm test -pqdm -timm # required for internvl test +genai_perf==0.0.8 +tritonclient==2.51.0 -schemathesis==3.39.15 # Required for openai schema test. -mteb>=1.38.11, <2 # required for mteb test +numba == 0.60.0; python_version == '3.9' # v0.61 doesn't support Python 3.9. Required for N-gram speculative decoding +numba == 0.61.2; python_version > '3.9' +numpy +runai-model-streamer==0.11.0 +runai-model-streamer-s3==0.11.0 +fastsafetensors>=0.1.10 +pydantic>=2.10 # 2.9 leads to error on python 3.10 diff --git a/requirements/test.in b/requirements/test.in index 55978fb10d58..6f9524e52e42 100644 --- a/requirements/test.in +++ b/requirements/test.in @@ -13,7 +13,6 @@ blobfile # required for kimi-vl test einops # required for MPT, qwen-vl and Mamba httpx librosa # required for audio tests -vector_quantize_pytorch # required for minicpmo_26 test vocos # required for minicpmo_26 test peft pqdm @@ -22,9 +21,7 @@ sentence-transformers # required for embedding tests soundfile # required for audio tests jiwer # required for audio tests timm # required for internvl test -torch==2.7.0 torchaudio==2.7.0 -torchvision==0.22.0 transformers_stream_generator # required for qwen-vl test mamba_ssm # required for plamo2 test matplotlib # required for qwen-vl test @@ -51,4 +48,4 @@ numpy runai-model-streamer==0.11.0 runai-model-streamer-s3==0.11.0 fastsafetensors>=0.1.10 -pydantic>=2.10 # 2.9 leads to error on python 3.10 \ No newline at end of file +pydantic>=2.10 # 2.9 leads to error on python 3.10 diff --git a/tools/generate_nightly_torch_test.py b/tools/generate_nightly_torch_test.py new file mode 100644 index 000000000000..6bfef7fe6c0b --- /dev/null +++ b/tools/generate_nightly_torch_test.py @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: Copyright contributors to the vLLM project +input_file = "requirements/test.in" +cleaned_output = "requirements/nightly_torch_test.txt" +torch_output = "torch_nightly_test.txt" + +keywords = ["torch", "torchaudio", "torchvision", "mamba_ssm"] + +with open(input_file) as f: + lines = f.readlines() + +cleaned_lines = [] +torch_lines = [] +skip_next = False + +for line in lines: + line_lower = line.lower() + + if not skip_next: + if any(keyword in line_lower for keyword in keywords): + torch_lines.append(line) + print(f" Removed: {line.strip()}") + skip_next = True + continue + else: + if line.startswith(" ") or line.startswith("\t") or line.strip() == "": + torch_lines.append(line) + print(f" Removed (context): {line.strip()}") + continue + else: + skip_next = False + + if not skip_next: + cleaned_lines.append(line) + +# Write cleaned lines to new file +with open(cleaned_output, "w") as f: + f.writelines(cleaned_lines) +print(f">>> Cleaned file written to {cleaned_output}") + +# Write removed torch-related lines +if torch_lines: + with open(torch_output, "w") as f: + f.writelines(torch_lines) + print(f">>> Removed lines written to {torch_output}") +else: + print("No matching lines found.") diff --git a/torch_nightly_test.txt b/torch_nightly_test.txt new file mode 100644 index 000000000000..a32016d79824 --- /dev/null +++ b/torch_nightly_test.txt @@ -0,0 +1,2 @@ +torchaudio==2.7.0 +mamba_ssm # required for plamo2 test From e14a4e0781674e805c52c088f79d7d2c2d74cb4a Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Fri, 13 Jun 2025 18:36:48 -0700 Subject: [PATCH 02/21] final Signed-off-by: Yang Wang --- tools/generate_nightly_torch_test.py | 9 --------- torch_nightly_test.txt | 2 -- 2 files changed, 11 deletions(-) delete mode 100644 torch_nightly_test.txt diff --git a/tools/generate_nightly_torch_test.py b/tools/generate_nightly_torch_test.py index 6bfef7fe6c0b..b2fa40686ffc 100644 --- a/tools/generate_nightly_torch_test.py +++ b/tools/generate_nightly_torch_test.py @@ -2,7 +2,6 @@ # SPDX-FileCopyrightText: Copyright contributors to the vLLM project input_file = "requirements/test.in" cleaned_output = "requirements/nightly_torch_test.txt" -torch_output = "torch_nightly_test.txt" keywords = ["torch", "torchaudio", "torchvision", "mamba_ssm"] @@ -37,11 +36,3 @@ with open(cleaned_output, "w") as f: f.writelines(cleaned_lines) print(f">>> Cleaned file written to {cleaned_output}") - -# Write removed torch-related lines -if torch_lines: - with open(torch_output, "w") as f: - f.writelines(torch_lines) - print(f">>> Removed lines written to {torch_output}") -else: - print("No matching lines found.") diff --git a/torch_nightly_test.txt b/torch_nightly_test.txt deleted file mode 100644 index a32016d79824..000000000000 --- a/torch_nightly_test.txt +++ /dev/null @@ -1,2 +0,0 @@ -torchaudio==2.7.0 -mamba_ssm # required for plamo2 test From 98cf80af78b62119bd2c0d2219d683d7f44ff778 Mon Sep 17 00:00:00 2001 From: Concurrensee Date: Fri, 13 Jun 2025 19:08:51 -0500 Subject: [PATCH 03/21] Adding "AMD: Multi-step Tests" to amdproduction. (#19508) Signed-off-by: Yida Wu Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Cyrus Leung Signed-off-by: Yang Wang --- .buildkite/test-pipeline.yaml | 2 +- tests/multi_step/test_correctness_llm.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.buildkite/test-pipeline.yaml b/.buildkite/test-pipeline.yaml index 364561c46c26..8f3986270868 100644 --- a/.buildkite/test-pipeline.yaml +++ b/.buildkite/test-pipeline.yaml @@ -675,7 +675,7 @@ steps: - pytest -v -s plugins/lora_resolvers # unit tests for in-tree lora resolver plugins - label: Multi-step Tests (4 GPUs) # 36min - mirror_hardwares: [amdexperimental] + mirror_hardwares: [amdexperimental, amdproduction] working_dir: "/vllm-workspace/tests" num_gpus: 4 source_file_dependencies: diff --git a/tests/multi_step/test_correctness_llm.py b/tests/multi_step/test_correctness_llm.py index 9f1b3bbe8e22..0df00c98b72c 100644 --- a/tests/multi_step/test_correctness_llm.py +++ b/tests/multi_step/test_correctness_llm.py @@ -8,6 +8,7 @@ import pytest +from vllm.platforms import current_platform from vllm.utils import STR_BACKEND_ENV_VAR from ..models.utils import check_logprobs_close, check_outputs_equal @@ -71,6 +72,12 @@ def test_multi_step_llm( num_logprobs: corresponds to the `logprobs` argument to the OpenAI completions endpoint; `None` -> 1 logprob returned. """ + if current_platform.is_rocm() and \ + (attention_backend == "FLASHINFER" or enable_chunked_prefill): + pytest.skip( + "Multi-Step with FLASHINFER or Chunked-Prefill is not supported" + "on ROCm") + with monkeypatch.context() as m: m.setenv(STR_BACKEND_ENV_VAR, attention_backend) @@ -221,6 +228,9 @@ def test_multi_step_llm_w_prompt_logprobs( @pytest.mark.parametrize("num_prompts", NUM_PROMPTS) @pytest.mark.parametrize("num_logprobs", [None, 5]) @pytest.mark.parametrize("attention_backend", ["FLASH_ATTN"]) +@pytest.mark.skipif( + current_platform.is_rocm(), + reason="Multi-Step + Chunked-Prefill not supported on ROCm") def test_multi_step_llm_chunked_prefill_prefix_cache( vllm_runner, example_prompts, From 5c19484a9afa06f5b7347d025255d1ffe26ea44a Mon Sep 17 00:00:00 2001 From: Nick Hill Date: Fri, 13 Jun 2025 17:18:03 -0700 Subject: [PATCH 04/21] [BugFix] Fix DP Coordinator incorrect debug log message (#19624) Signed-off-by: Nick Hill Signed-off-by: Yang Wang --- vllm/v1/engine/coordinator.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/vllm/v1/engine/coordinator.py b/vllm/v1/engine/coordinator.py index 4f6ba099c650..031e9b85f24c 100644 --- a/vllm/v1/engine/coordinator.py +++ b/vllm/v1/engine/coordinator.py @@ -183,11 +183,12 @@ def process_input_socket(self, front_publish_address: str, # engines are paused, so that we can wake the other # engines. engine_to_exclude, wave = msgspec.msgpack.decode(buffer) - if wave < self.current_wave: - # If the wave number is stale, ensure the message is - # handled by all the engines. - engine_to_exclude = None if not self.engines_running: + if wave < self.current_wave: + # If the wave number is stale, ensure the message + # is handled by all the engines. + engine_to_exclude = None + self.engines_running = True self.stats_changed = True self._send_start_wave(publish_back, self.current_wave, @@ -203,22 +204,24 @@ def process_input_socket(self, front_publish_address: str, assert outputs.utility_output is None eng_index = outputs.engine_index - if outputs.scheduler_stats: + scheduler_stats = outputs.scheduler_stats + if scheduler_stats: # 1. Updated request load stats - update our local # state with these. stats = self.engines[eng_index].request_counts - stats[0] = outputs.scheduler_stats.num_waiting_reqs - stats[1] = outputs.scheduler_stats.num_running_reqs + stats[0] = scheduler_stats.num_waiting_reqs + stats[1] = scheduler_stats.num_running_reqs self.stats_changed = True if (wave := outputs.wave_complete) is not None: # 2. Notification from rank 0 engine that we've # moved into the global paused state - # (engines_running==False) + # (engines_running==False). if self.current_wave <= wave: + new_wave = wave + 1 logger.debug("Moving DP wave from %d to %d.", - self.current_wave, wave) - self.current_wave = wave + 1 + self.current_wave, new_wave) + self.current_wave = new_wave self.engines_running = False self.stats_changed = True elif (wave := outputs.start_wave) is not None and ( From fc81e3909c6a3491661f36848dd6749a890864ce Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Fri, 13 Jun 2025 18:47:46 -0700 Subject: [PATCH 05/21] final Signed-off-by: Yang Wang --- requirements/test.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/requirements/test.in b/requirements/test.in index 6f9524e52e42..02e0c44afdbf 100644 --- a/requirements/test.in +++ b/requirements/test.in @@ -13,6 +13,7 @@ blobfile # required for kimi-vl test einops # required for MPT, qwen-vl and Mamba httpx librosa # required for audio tests +vector_quantize_pytorch # required for minicpmo_26 test vocos # required for minicpmo_26 test peft pqdm @@ -21,7 +22,9 @@ sentence-transformers # required for embedding tests soundfile # required for audio tests jiwer # required for audio tests timm # required for internvl test +torch==2.7.0 torchaudio==2.7.0 +torchvision==0.22.0 transformers_stream_generator # required for qwen-vl test mamba_ssm # required for plamo2 test matplotlib # required for qwen-vl test From e649cd684015af8500b92fc0b1c61899883d5e4a Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Fri, 13 Jun 2025 18:50:26 -0700 Subject: [PATCH 06/21] Update tools/generate_nightly_torch_test.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Yang Wang --- tools/generate_nightly_torch_test.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/generate_nightly_torch_test.py b/tools/generate_nightly_torch_test.py index b2fa40686ffc..3a006541a9e4 100644 --- a/tools/generate_nightly_torch_test.py +++ b/tools/generate_nightly_torch_test.py @@ -1,5 +1,13 @@ # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project +""" +Generates specialized requirements files for nightly PyTorch testing. + +This script reads the main test requirements input file (`requirements/test.in`) +and splits its content into two files: +1. `requirements/nightly_torch_test.txt`: Contains dependencies except PyTorch-related. +2. `torch_nightly_test.txt`: Contains only PyTorch-related packages. +""" input_file = "requirements/test.in" cleaned_output = "requirements/nightly_torch_test.txt" From 3543362ef7978437f204f286c393ae1997c39a56 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Fri, 13 Jun 2025 19:08:04 -0700 Subject: [PATCH 07/21] final Signed-off-by: Yang Wang --- .pre-commit-config.yaml | 1 - requirements/nightly_torch_test.txt | 1 + requirements/test.in | 1 + tools/generate_nightly_torch_test.py | 37 +++++++++++----------------- 4 files changed, 16 insertions(+), 24 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 43efa139c74c..9ccddd8d99cf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -58,7 +58,6 @@ repos: language: python entry: python tools/generate_nightly_torch_test.py files: ^requirements/test\.(in|txt)$ - types: [python] - id: mypy-local name: Run mypy for local Python installation entry: tools/mypy.sh 0 "local" diff --git a/requirements/nightly_torch_test.txt b/requirements/nightly_torch_test.txt index 3a961fcc423b..fd0b0fac12a9 100644 --- a/requirements/nightly_torch_test.txt +++ b/requirements/nightly_torch_test.txt @@ -37,6 +37,7 @@ schemathesis>=3.39.15 # Required for openai schema test. bitsandbytes>=0.45.3 buildkite-test-collector==0.1.9 + genai_perf==0.0.8 tritonclient==2.51.0 diff --git a/requirements/test.in b/requirements/test.in index 02e0c44afdbf..5adad1ef134a 100644 --- a/requirements/test.in +++ b/requirements/test.in @@ -42,6 +42,7 @@ schemathesis>=3.39.15 # Required for openai schema test. bitsandbytes>=0.45.3 buildkite-test-collector==0.1.9 + genai_perf==0.0.8 tritonclient==2.51.0 diff --git a/tools/generate_nightly_torch_test.py b/tools/generate_nightly_torch_test.py index 3a006541a9e4..038d627381aa 100644 --- a/tools/generate_nightly_torch_test.py +++ b/tools/generate_nightly_torch_test.py @@ -8,39 +8,30 @@ 1. `requirements/nightly_torch_test.txt`: Contains dependencies except PyTorch-related. 2. `torch_nightly_test.txt`: Contains only PyTorch-related packages. """ + input_file = "requirements/test.in" -cleaned_output = "requirements/nightly_torch_test.txt" +output_file = "requirements/nightly_torch_test.txt" keywords = ["torch", "torchaudio", "torchvision", "mamba_ssm"] with open(input_file) as f: lines = f.readlines() -cleaned_lines = [] -torch_lines = [] +cleaned = [] +# clean all immediately following indented or empty lines to skip_next = False for line in lines: - line_lower = line.lower() - - if not skip_next: - if any(keyword in line_lower for keyword in keywords): - torch_lines.append(line) - print(f" Removed: {line.strip()}") - skip_next = True + if skip_next: + if line.startswith((" ", "\t")) or line.strip() == "": continue - else: - if line.startswith(" ") or line.startswith("\t") or line.strip() == "": - torch_lines.append(line) - print(f" Removed (context): {line.strip()}") - continue - else: - skip_next = False + skip_next = False + + if any(k in line.lower() for k in keywords): + skip_next = True + continue - if not skip_next: - cleaned_lines.append(line) + cleaned.append(line) -# Write cleaned lines to new file -with open(cleaned_output, "w") as f: - f.writelines(cleaned_lines) -print(f">>> Cleaned file written to {cleaned_output}") +with open(output_file, "w") as f: + f.writelines(cleaned) From f6a4fe5f3f4ba1533113857ab29ea467e90af6b2 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Fri, 13 Jun 2025 19:33:36 -0700 Subject: [PATCH 08/21] final Signed-off-by: Yang Wang --- .buildkite/test-pipeline.yaml | 17 +++++++++- .../pytorch_nightly_dependency.sh | 34 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 tests/standalone_tests/pytorch_nightly_dependency.sh diff --git a/.buildkite/test-pipeline.yaml b/.buildkite/test-pipeline.yaml index 8f3986270868..fd6324b915c4 100644 --- a/.buildkite/test-pipeline.yaml +++ b/.buildkite/test-pipeline.yaml @@ -41,6 +41,21 @@ steps: # TODO: add `--strict` once warnings in docstrings are fixed - mkdocs build +- label: Pytorch Nightly Dependency Override Check # 2min + fast_check: true + source_file_dependencies: + - requirements/nightly_torch_test.txt + commands: + - bash standalone_tests/pytorch_nightly_dependency.sh + + - label: Python-only Installation Test + mirror_hardwares: [amdexperimental] + source_file_dependencies: + - tests/standalone_tests/python_only_compile.sh + - setup.py + commands: + - bash standalone_tests/python_only_compile.sh + - label: Async Engine, Inputs, Utils, Worker Test # 24min mirror_hardwares: [amdexperimental] source_file_dependencies: @@ -736,7 +751,7 @@ steps: - bash weight_loading/run_model_weight_loading_test.sh -c weight_loading/models.txt - label: Weight Loading Multiple GPU Test - Large Models # optional - mirror_hardwares: [amdexperimental] + mirror_hardwares: [amdexperimental] working_dir: "/vllm-workspace/tests" num_gpus: 2 gpu: a100 diff --git a/tests/standalone_tests/pytorch_nightly_dependency.sh b/tests/standalone_tests/pytorch_nightly_dependency.sh new file mode 100644 index 000000000000..743028eef744 --- /dev/null +++ b/tests/standalone_tests/pytorch_nightly_dependency.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +set -e +set -x + +echo ">>> Current torch-related packages (before uninstall):" +pip freeze | grep -E '^torch|^torchvision|^torchaudio' || echo "None found" + +echo ">>> Uninstalling previous PyTorch packages (if any)" +pip uninstall -y torch torchvision torchaudio vllm|| true + +echo ">>> Installing nightly torch packages" +pip install --quiet torch torchvision torchaudio --pre --extra-index-url https://download.pytorch.org/whl/nightly/cu128 + +echo ">>> Capturing torch-related versions before requirements install" +pip freeze | grep -E '^torch|^torchvision|^torchaudio' | sort > before.txt +echo "Before:" +cat before.txt + +echo ">>> Installing requirements/nightly_torch_test.txt" +pip install --quiet -r requirements/nightly_torch_test.txt + +echo ">>> Capturing torch-related versions after requirements install" +pip freeze | grep -E '^torch|^torchvision|^torchaudio' | sort > after.txt +echo "After:" +cat after.txt + +echo ">>> Comparing versions" +if diff before.txt after.txt; then + echo "✅ torch version not overridden." +else + echo "torch version overridden by nightly_torch_test.txt" + exit 1 +fi From 256107d7df9a22ec558ff19ebaa10f03b6092df9 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Fri, 13 Jun 2025 19:41:43 -0700 Subject: [PATCH 09/21] final Signed-off-by: Yang Wang --- .buildkite/test-pipeline.yaml | 1 + tests/standalone_tests/pytorch_nightly_dependency.sh | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.buildkite/test-pipeline.yaml b/.buildkite/test-pipeline.yaml index fd6324b915c4..7d24fd6a4c2f 100644 --- a/.buildkite/test-pipeline.yaml +++ b/.buildkite/test-pipeline.yaml @@ -43,6 +43,7 @@ steps: - label: Pytorch Nightly Dependency Override Check # 2min fast_check: true + torch_nightly: true source_file_dependencies: - requirements/nightly_torch_test.txt commands: diff --git a/tests/standalone_tests/pytorch_nightly_dependency.sh b/tests/standalone_tests/pytorch_nightly_dependency.sh index 743028eef744..dfc32c7db2d9 100644 --- a/tests/standalone_tests/pytorch_nightly_dependency.sh +++ b/tests/standalone_tests/pytorch_nightly_dependency.sh @@ -27,8 +27,9 @@ cat after.txt echo ">>> Comparing versions" if diff before.txt after.txt; then - echo "✅ torch version not overridden." + echo "torch version not overridden." else - echo "torch version overridden by nightly_torch_test.txt" + echo "torch version overridden by nightly_torch_test.txt, if the dependency is not triggered by the pytroch nightly test, + please add the dependency to the list 'keywords' in tools/generate_nightly_torch_test.py" exit 1 fi From ac2e1138245ccadb8d83b1eb17348a8a3cb5fefa Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Fri, 13 Jun 2025 19:42:39 -0700 Subject: [PATCH 10/21] final Signed-off-by: Yang Wang --- tools/generate_nightly_torch_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/generate_nightly_torch_test.py b/tools/generate_nightly_torch_test.py index 038d627381aa..63d1039175b4 100644 --- a/tools/generate_nightly_torch_test.py +++ b/tools/generate_nightly_torch_test.py @@ -5,7 +5,8 @@ This script reads the main test requirements input file (`requirements/test.in`) and splits its content into two files: -1. `requirements/nightly_torch_test.txt`: Contains dependencies except PyTorch-related. +1. `requirements/nightly_torch_test.txt`: Contains dependencies +except PyTorch-related. 2. `torch_nightly_test.txt`: Contains only PyTorch-related packages. """ From 193a0a6286e88351898928d0e95482d43f960d47 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Fri, 13 Jun 2025 19:44:20 -0700 Subject: [PATCH 11/21] final Signed-off-by: Yang Wang --- .buildkite/test-pipeline.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.buildkite/test-pipeline.yaml b/.buildkite/test-pipeline.yaml index 7d24fd6a4c2f..753f04acc103 100644 --- a/.buildkite/test-pipeline.yaml +++ b/.buildkite/test-pipeline.yaml @@ -49,14 +49,6 @@ steps: commands: - bash standalone_tests/pytorch_nightly_dependency.sh - - label: Python-only Installation Test - mirror_hardwares: [amdexperimental] - source_file_dependencies: - - tests/standalone_tests/python_only_compile.sh - - setup.py - commands: - - bash standalone_tests/python_only_compile.sh - - label: Async Engine, Inputs, Utils, Worker Test # 24min mirror_hardwares: [amdexperimental] source_file_dependencies: From a23e2672550f8497ce110dc2fadf59c1f8dbf1eb Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Fri, 13 Jun 2025 19:51:40 -0700 Subject: [PATCH 12/21] final Signed-off-by: Yang Wang --- .buildkite/test-pipeline.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.buildkite/test-pipeline.yaml b/.buildkite/test-pipeline.yaml index 753f04acc103..f6f2e365ea7a 100644 --- a/.buildkite/test-pipeline.yaml +++ b/.buildkite/test-pipeline.yaml @@ -43,7 +43,6 @@ steps: - label: Pytorch Nightly Dependency Override Check # 2min fast_check: true - torch_nightly: true source_file_dependencies: - requirements/nightly_torch_test.txt commands: From ebfe912e515360b5983b51865d083e9d71865aae Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Fri, 13 Jun 2025 19:52:13 -0700 Subject: [PATCH 13/21] final Signed-off-by: Yang Wang --- .buildkite/test-pipeline.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.buildkite/test-pipeline.yaml b/.buildkite/test-pipeline.yaml index f6f2e365ea7a..753f04acc103 100644 --- a/.buildkite/test-pipeline.yaml +++ b/.buildkite/test-pipeline.yaml @@ -43,6 +43,7 @@ steps: - label: Pytorch Nightly Dependency Override Check # 2min fast_check: true + torch_nightly: true source_file_dependencies: - requirements/nightly_torch_test.txt commands: From 371754af7542907637e0fe46dda79094a2632f4a Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Fri, 13 Jun 2025 20:34:39 -0700 Subject: [PATCH 14/21] final Signed-off-by: Yang Wang --- tests/standalone_tests/pytorch_nightly_dependency.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/standalone_tests/pytorch_nightly_dependency.sh b/tests/standalone_tests/pytorch_nightly_dependency.sh index dfc32c7db2d9..b3e66e5659e8 100644 --- a/tests/standalone_tests/pytorch_nightly_dependency.sh +++ b/tests/standalone_tests/pytorch_nightly_dependency.sh @@ -3,8 +3,8 @@ set -e set -x -echo ">>> Current torch-related packages (before uninstall):" -pip freeze | grep -E '^torch|^torchvision|^torchaudio' || echo "None found" +echo ">>> uninstall everything from requirements/test.txt" +pip uninstall -y $(grep -vE '^\s*#' requirements/test.txt | cut -d '=' -f 1) echo ">>> Uninstalling previous PyTorch packages (if any)" pip uninstall -y torch torchvision torchaudio vllm|| true From ede3836f4482491c9464d13682db347f55ff912c Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Fri, 13 Jun 2025 20:35:20 -0700 Subject: [PATCH 15/21] final Signed-off-by: Yang Wang --- tests/standalone_tests/pytorch_nightly_dependency.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/standalone_tests/pytorch_nightly_dependency.sh b/tests/standalone_tests/pytorch_nightly_dependency.sh index b3e66e5659e8..c02a6d45f0ef 100644 --- a/tests/standalone_tests/pytorch_nightly_dependency.sh +++ b/tests/standalone_tests/pytorch_nightly_dependency.sh @@ -4,7 +4,7 @@ set -e set -x echo ">>> uninstall everything from requirements/test.txt" -pip uninstall -y $(grep -vE '^\s*#' requirements/test.txt | cut -d '=' -f 1) +grep -vE '^\s*#' requirements.txt | cut -d '=' -f 1 | xargs -n 1 pip uninstall -y echo ">>> Uninstalling previous PyTorch packages (if any)" pip uninstall -y torch torchvision torchaudio vllm|| true From 081e57f63d830fb8ccf42f70472b448263882b9c Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Fri, 13 Jun 2025 20:37:11 -0700 Subject: [PATCH 16/21] final Signed-off-by: Yang Wang --- tests/standalone_tests/pytorch_nightly_dependency.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/standalone_tests/pytorch_nightly_dependency.sh b/tests/standalone_tests/pytorch_nightly_dependency.sh index c02a6d45f0ef..5077b4eb48d7 100644 --- a/tests/standalone_tests/pytorch_nightly_dependency.sh +++ b/tests/standalone_tests/pytorch_nightly_dependency.sh @@ -6,8 +6,8 @@ set -x echo ">>> uninstall everything from requirements/test.txt" grep -vE '^\s*#' requirements.txt | cut -d '=' -f 1 | xargs -n 1 pip uninstall -y -echo ">>> Uninstalling previous PyTorch packages (if any)" -pip uninstall -y torch torchvision torchaudio vllm|| true +# check the environment +pip freeze echo ">>> Installing nightly torch packages" pip install --quiet torch torchvision torchaudio --pre --extra-index-url https://download.pytorch.org/whl/nightly/cu128 From 66fbc7fae35320f66e088daae71ce4d2382cc18e Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Fri, 13 Jun 2025 20:38:37 -0700 Subject: [PATCH 17/21] final Signed-off-by: Yang Wang --- tests/standalone_tests/pytorch_nightly_dependency.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/standalone_tests/pytorch_nightly_dependency.sh b/tests/standalone_tests/pytorch_nightly_dependency.sh index 5077b4eb48d7..30450e163bf3 100644 --- a/tests/standalone_tests/pytorch_nightly_dependency.sh +++ b/tests/standalone_tests/pytorch_nightly_dependency.sh @@ -29,7 +29,8 @@ echo ">>> Comparing versions" if diff before.txt after.txt; then echo "torch version not overridden." else - echo "torch version overridden by nightly_torch_test.txt, if the dependency is not triggered by the pytroch nightly test, + echo "torch version overridden by nightly_torch_test.txt, \ + if the dependency is not triggered by the pytroch nightly test,\ please add the dependency to the list 'keywords' in tools/generate_nightly_torch_test.py" exit 1 fi From 4cddf8fc2e29dbb849b4e67adb4964522ceda20a Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Wed, 18 Jun 2025 12:08:30 -0700 Subject: [PATCH 18/21] fix error test Signed-off-by: Yang Wang --- tests/standalone_tests/pytorch_nightly_dependency.sh | 10 ++++++++-- tools/generate_nightly_torch_test.py | 6 ++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/standalone_tests/pytorch_nightly_dependency.sh b/tests/standalone_tests/pytorch_nightly_dependency.sh index 30450e163bf3..11d5346822cc 100644 --- a/tests/standalone_tests/pytorch_nightly_dependency.sh +++ b/tests/standalone_tests/pytorch_nightly_dependency.sh @@ -1,10 +1,16 @@ #!/bin/sh +# This script tests if the nightly torch packages are not overridden by the dependencies set -e set -x +cd /vllm-workspace/ + +# check the environment +pip freeze + echo ">>> uninstall everything from requirements/test.txt" -grep -vE '^\s*#' requirements.txt | cut -d '=' -f 1 | xargs -n 1 pip uninstall -y +grep -vE '^\s*#' requirements/test.txt | cut -d '=' -f 1 | xargs -n 1 pip uninstall -y # check the environment pip freeze @@ -31,6 +37,6 @@ if diff before.txt after.txt; then else echo "torch version overridden by nightly_torch_test.txt, \ if the dependency is not triggered by the pytroch nightly test,\ - please add the dependency to the list 'keywords' in tools/generate_nightly_torch_test.py" + please add the dependency to the list 'white_list' in tools/generate_nightly_torch_test.py" exit 1 fi diff --git a/tools/generate_nightly_torch_test.py b/tools/generate_nightly_torch_test.py index 63d1039175b4..c1b88901f670 100644 --- a/tools/generate_nightly_torch_test.py +++ b/tools/generate_nightly_torch_test.py @@ -13,7 +13,9 @@ input_file = "requirements/test.in" output_file = "requirements/nightly_torch_test.txt" -keywords = ["torch", "torchaudio", "torchvision", "mamba_ssm"] +# white list of packages that are not compatible with PyTorch nightly directly +# with pip install. +white_list = ["torch", "torchaudio", "torchvision", "mamba_ssm"] with open(input_file) as f: lines = f.readlines() @@ -28,7 +30,7 @@ continue skip_next = False - if any(k in line.lower() for k in keywords): + if any(k in line.lower() for k in white_list): skip_next = True continue From c7515b9d3a63c1d6bece45abd00a181939b12e55 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Wed, 18 Jun 2025 13:45:37 -0700 Subject: [PATCH 19/21] fix error test Signed-off-by: Yang Wang --- .../pytorch_nightly_dependency.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/standalone_tests/pytorch_nightly_dependency.sh b/tests/standalone_tests/pytorch_nightly_dependency.sh index 11d5346822cc..cb531e13ecb8 100644 --- a/tests/standalone_tests/pytorch_nightly_dependency.sh +++ b/tests/standalone_tests/pytorch_nightly_dependency.sh @@ -6,28 +6,28 @@ set -x cd /vllm-workspace/ -# check the environment -pip freeze +rm -rf .venv + +uv venv .venv -echo ">>> uninstall everything from requirements/test.txt" -grep -vE '^\s*#' requirements/test.txt | cut -d '=' -f 1 | xargs -n 1 pip uninstall -y +source .venv/bin/activate # check the environment -pip freeze +uv pip freeze echo ">>> Installing nightly torch packages" -pip install --quiet torch torchvision torchaudio --pre --extra-index-url https://download.pytorch.org/whl/nightly/cu128 +uv pip install --quiet torch torchvision torchaudio --pre --extra-index-url https://download.pytorch.org/whl/nightly/cu128 echo ">>> Capturing torch-related versions before requirements install" -pip freeze | grep -E '^torch|^torchvision|^torchaudio' | sort > before.txt +uv pip freeze | grep -E '^torch|^torchvision|^torchaudio' | sort > before.txt echo "Before:" cat before.txt echo ">>> Installing requirements/nightly_torch_test.txt" -pip install --quiet -r requirements/nightly_torch_test.txt +uv pip install --quiet -r requirements/nightly_torch_test.txt echo ">>> Capturing torch-related versions after requirements install" -pip freeze | grep -E '^torch|^torchvision|^torchaudio' | sort > after.txt +uv pip freeze | grep -E '^torch|^torchvision|^torchaudio' | sort > after.txt echo "After:" cat after.txt From 353ef534ab433f2041f1a3e66ed185d9cc3bddd4 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Wed, 18 Jun 2025 18:49:12 -0700 Subject: [PATCH 20/21] fix error test Signed-off-by: Yang Wang --- .buildkite/test-pipeline.yaml | 3 +-- tools/generate_nightly_torch_test.py | 7 ------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.buildkite/test-pipeline.yaml b/.buildkite/test-pipeline.yaml index 753f04acc103..a7e14913324f 100644 --- a/.buildkite/test-pipeline.yaml +++ b/.buildkite/test-pipeline.yaml @@ -42,8 +42,7 @@ steps: - mkdocs build - label: Pytorch Nightly Dependency Override Check # 2min - fast_check: true - torch_nightly: true + soft_fail: true source_file_dependencies: - requirements/nightly_torch_test.txt commands: diff --git a/tools/generate_nightly_torch_test.py b/tools/generate_nightly_torch_test.py index c1b88901f670..81e423bd8dae 100644 --- a/tools/generate_nightly_torch_test.py +++ b/tools/generate_nightly_torch_test.py @@ -20,8 +20,6 @@ with open(input_file) as f: lines = f.readlines() -cleaned = [] -# clean all immediately following indented or empty lines to skip_next = False for line in lines: @@ -33,8 +31,3 @@ if any(k in line.lower() for k in white_list): skip_next = True continue - - cleaned.append(line) - -with open(output_file, "w") as f: - f.writelines(cleaned) From b245e6c3335c9651d1b429b1ec8ed724110fdd8b Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Wed, 18 Jun 2025 18:52:31 -0700 Subject: [PATCH 21/21] fix error test Signed-off-by: Yang Wang --- .buildkite/test-pipeline.yaml | 3 +++ tools/generate_nightly_torch_test.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.buildkite/test-pipeline.yaml b/.buildkite/test-pipeline.yaml index a7e14913324f..1443e27be72a 100644 --- a/.buildkite/test-pipeline.yaml +++ b/.buildkite/test-pipeline.yaml @@ -42,6 +42,9 @@ steps: - mkdocs build - label: Pytorch Nightly Dependency Override Check # 2min + # if this test fails, it means the nightly torch version is not compatible with some + # of the dependencies. Please check the error message and add the package to whitelist + # in /vllm/tools/generate_nightly_torch_test.py soft_fail: true source_file_dependencies: - requirements/nightly_torch_test.txt diff --git a/tools/generate_nightly_torch_test.py b/tools/generate_nightly_torch_test.py index 81e423bd8dae..a3d7f7a609ba 100644 --- a/tools/generate_nightly_torch_test.py +++ b/tools/generate_nightly_torch_test.py @@ -14,7 +14,8 @@ output_file = "requirements/nightly_torch_test.txt" # white list of packages that are not compatible with PyTorch nightly directly -# with pip install. +# with pip install. Please add your package to this list if it is not compatible +# or make the dependency test fails. white_list = ["torch", "torchaudio", "torchvision", "mamba_ssm"] with open(input_file) as f: