[CI][ROCm] Skip unsupported test cases on ROCm (#46160)

Signed-off-by: Felix Marty <Felix.Marty@amd.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

fxmarty-amd committed Jun 23, 2026 at 18:35 UTC fd50a66015b5b3095552be53ab7658b564458123
2 files changed +34 -2
tests/quantization/test_compressed_tensors.py
+27 -2
@@ -5,6 +5,7 @@
5 Run `pytest tests/quantization/test_compressed_tensors.py`.
6 """
7
8 +from contextlib import contextmanager
9 from unittest.mock import Mock
10
11 import pytest
@@ -370,6 +371,27 @@ def test_compressed_tensors_kv_cache_fp8_per_attn_head(vllm_runner):
371 assert output
372
373
374 +@contextmanager
375 +def _nvfp4_marlin_error_context(model, capfd):
376 + is_rocm_and_unsupported = (
377 + model == "nm-testing/TinyLlama-1.1B-Chat-v1.0-NVFP4A16"
378 + and current_platform.is_rocm()
379 + )
380 +
381 + if is_rocm_and_unsupported:
382 + expected_error = (
383 + "ValueError: Forced NVFP4 kernel MarlinNvFp4LinearKernel is not "
384 + "supported: Marlin FP4 not available"
385 + )
386 + with pytest.raises(RuntimeError, match="Engine core initialization failed"):
387 + yield
388 +
389 + captured = capfd.readouterr()
390 + assert expected_error in captured.out + captured.err
391 + else:
392 + yield
393 +
394 +
395 @pytest.mark.parametrize(
396 "args",
397 [
@@ -377,9 +399,12 @@ def test_compressed_tensors_kv_cache_fp8_per_attn_head(vllm_runner):
399 ("nm-testing/TinyLlama-1.1B-Chat-v1.0-NVFP4", False),
400 ],
401 )
380 -def test_compressed_tensors_nvfp4(vllm_runner, args):
402 +def test_compressed_tensors_nvfp4(vllm_runner, args, capfd):
403 model, use_a16 = args
382 - with vllm_runner(model, enforce_eager=True) as llm:
404 + with (
405 + _nvfp4_marlin_error_context(model, capfd),
406 + vllm_runner(model, enforce_eager=True) as llm,
407 + ):
408
409 def check_model(model):
410 layer = model.model.layers[0]
tests/quantization/test_modelopt.py
+7
@@ -25,6 +25,7 @@ from vllm.model_executor.layers.vocab_parallel_embedding import (
25 ParallelLMHead,
26 VocabParallelEmbedding,
27 )
28 +from vllm.platforms import current_platform
29
30
31 @pytest.fixture(scope="function", autouse=True)
@@ -467,6 +468,12 @@ def test_modelopt_mixed_precision_dispatches_w4a16_layer(
468 from vllm.model_executor.layers.linear import LinearBase
469 from vllm.model_executor.layers.quantization import modelopt as m
470
471 + if (
472 + expected_linear_cls_name == "ModelOptNvFp4W4A16LinearMethod"
473 + and current_platform.is_rocm()
474 + ):
475 + pytest.skip("ModelOptNvFp4W4A16LinearMethod is not supported with rocm")
476 +
477 hf_quant_config: dict[str, Any] = {
478 "quantization": {
479 "quant_algo": "MIXED_PRECISION",