A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 12, 18:30 UTC
[CI] Add batch invariant test to ci (#27842)
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Wentao Ye committed
Nov 21, 2025 at 11:20 UTC
1f400c58b8a6d2852b137cd841206a6ea8aaf43a
3 files changed
+16
-1
.buildkite/test-pipeline.yaml
+12
@@ -346,6 +346,18 @@ steps:
346
commands:
347
- pytest -v -s v1/attention
348
349
+- label: Batch Invariance Tests (H100) # 10min
350
+ timeout_in_minutes: 25
351
+ gpu: h100
352
+ source_file_dependencies:
353
+ - vllm/
354
+ - tests/v1/determinism/
355
+ commands:
356
+ - export VLLM_WORKER_MULTIPROC_METHOD=spawn
357
+ - pip install pytest-timeout pytest-forked
358
+ - pytest -v -s v1/determinism/test_batch_invariance.py
359
+ - pytest -v -s v1/determinism/test_rms_norm_batch_invariant.py
360
+
361
- label: V1 Test attention (B200) # 10min
362
timeout_in_minutes: 30
363
gpu: b200
tests/v1/determinism/test_batch_invariance.py
+2
@@ -190,6 +190,7 @@ def test_logprobs_bitwise_batch_invariance_bs1_vs_bsN(
190
max_num_seqs=32,
191
max_model_len=8192,
192
dtype="bfloat16", # not everything is supported
193
+ gpu_memory_utilization=0.9,
194
)
195
196
# Use more realistic prompts for better token generation
@@ -444,6 +445,7 @@ def test_logprobs_without_batch_invariance_should_fail(
445
monkeypatch.setenv("VLLM_ATTENTION_BACKEND", backend)
446
447
# CRITICAL: Disable batch invariance for this test
448
+ monkeypatch.setenv("VLLM_BATCH_INVARIANT", "0")
449
monkeypatch.setattr(batch_invariant, "VLLM_BATCH_INVARIANT", False)
450
seed = int(os.getenv("VLLM_TEST_SEED", "12345"))
451
random.seed(seed)
tests/v1/determinism/utils.py
+2
-1
@@ -6,6 +6,7 @@ import random
6
import pytest
7
import torch
8
9
+from vllm.attention.utils.fa_utils import flash_attn_supports_mla
10
from vllm.platforms import current_platform
11
12
skip_unsupported = pytest.mark.skipif(
@@ -18,7 +19,7 @@ BACKENDS: list[str] = [
19
"FLASHINFER",
20
]
21
21
-if current_platform.is_cuda() and current_platform.is_device_capability(90):
22
+if flash_attn_supports_mla():
23
BACKENDS.append("FLASH_ATTN_MLA")
24
25
DEFAULT_MODEL = "Qwen/Qwen3-1.7B"