[ROCm][CI] Stabilize ngram and suffix correctness test (#50190)
Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
Andreas Karatzas committed
Jul 28, 2026 at 21:29 UTC
7398a30d79758559704d4f28173b3594b2ec1345
1 file changed
+19
-8
tests/v1/e2e/spec_decode/test_spec_decode.py
+19
-8
@@ -23,7 +23,7 @@ from vllm import LLM, SamplingParams
23
from vllm.assets.base import VLLM_S3_BUCKET_URL
24
from vllm.assets.image import VLM_IMAGES_DIR
25
from vllm.benchmarks.datasets import InstructCoderDataset
26
-from vllm.config import VllmConfig, replace
26
+from vllm.config import CompilationConfig, VllmConfig, replace
27
from vllm.distributed import cleanup_dist_env_and_memory
28
from vllm.engine.arg_utils import EngineArgs
29
from vllm.platforms import current_platform
@@ -160,6 +160,12 @@ def reset_torch_dynamo():
160
torch._dynamo.reset()
161
162
163
+@pytest.fixture
164
+def disable_vllm_compile_cache_on_rocm(request: pytest.FixtureRequest) -> None:
165
+ if current_platform.is_rocm():
166
+ request.getfixturevalue("disable_vllm_compile_cache")
167
+
168
+
169
@pytest.mark.parametrize(
170
"speculative_config",
171
[
@@ -175,21 +181,26 @@ def reset_torch_dynamo():
181
},
182
],
183
)
184
+@pytest.mark.usefixtures("disable_vllm_compile_cache_on_rocm")
185
@single_gpu_only
186
@large_gpu_mark(min_gb=20)
187
def test_ngram_and_suffix_correctness(
188
speculative_config: dict,
189
model_name: str,
190
+ vllm_runner,
191
):
184
- spec_llm = LLM(
185
- model=model_name,
192
+ with vllm_runner(
193
+ model_name,
194
+ # Keep LLM defaults; VllmRunner only provides lifecycle cleanup here.
195
+ trust_remote_code=False,
196
+ enable_chunked_prefill=None,
197
speculative_config=speculative_config,
198
max_model_len=4096,
188
- )
189
- evaluate_llm_for_gsm8k(spec_llm)
190
- del spec_llm
191
- torch.accelerator.empty_cache()
192
- cleanup_dist_env_and_memory()
199
+ # Preserve LLM's default compilation/cudagraph configuration. Without
200
+ # this, VllmRunner injects its reduced test-only capture sizes.
201
+ compilation_config=CompilationConfig(),
202
+ ) as runner:
203
+ evaluate_llm_for_gsm8k(runner.llm)
204
205
206
@pytest.mark.parametrize("async_scheduling", [True], ids=["async"])