diff --git a/tests/v1/e2e/general/test_async_scheduling_accuracy.py b/tests/v1/e2e/general/test_async_scheduling_accuracy.py index 3ffcaefdc3..249f2c5ef7 100644 --- a/tests/v1/e2e/general/test_async_scheduling_accuracy.py +++ b/tests/v1/e2e/general/test_async_scheduling_accuracy.py @@ -12,6 +12,7 @@ from typing import Any import pytest import torch +import vllm.envs as envs from tests.conftest import HfRunner, VllmRunner from tests.utils import ( large_gpu_mark, @@ -168,9 +169,16 @@ def test_with_eagle3_spec_decoding( reason=("XPU matmul/attention kernels are not batch-invariant"), ) def test_with_ngram_gpu_spec_decoding( - vllm_runner: type[VllmRunner], hf_runner: type[HfRunner] + vllm_runner: type[VllmRunner], + hf_runner: type[HfRunner], + monkeypatch: pytest.MonkeyPatch, ): """Check ngram accuracy and acceptance across scheduling configurations.""" + if current_platform.is_rocm(): + # hipBLASLt picks GEMM solutions by batch shape, so sync and async runs + # can flip near-tie greedy tokens and shift ngram acceptance. + monkeypatch.setenv("VLLM_BATCH_INVARIANT", "1") + monkeypatch.setattr(envs, "VLLM_BATCH_INVARIANT", True) ngram_gpu_config = { "method": "ngram_gpu", "num_speculative_tokens": 3,