@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / fd65015a14
Fork 0

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, 17:15 UTC

[CI/Build] Only use supported types and features on ROCm in MoE kernel tests (#29149)

Signed-off-by: Randall Smith <ransmith@amd.com> Co-authored-by: Randall Smith <ransmith@amd.com>

rasmith committed Nov 21, 2025 at 21:34 UTC fd65015a14be5f2ce663cd959dff6970285c54b4
7 files changed +41 -2
tests/kernels/moe/test_batched_moe.py
+7 -2
@@ -39,6 +39,11 @@ MNK_FACTORS = [
39 NUM_EXPERTS = [8, 64]
40 TOP_KS = [1, 2, 6]
41
42 +DTYPES = [torch.bfloat16]
43 +
44 +if not current_platform.is_fp8_fnuz():
45 + DTYPES.append(torch.float8_e4m3fn)
46 +
47 vllm_config = VllmConfig()
48
49
@@ -96,7 +101,7 @@ class BatchedMMTensors:
101 @pytest.mark.parametrize("max_tokens_per_expert", [32, 224, 512])
102 @pytest.mark.parametrize("K", [128, 1024])
103 @pytest.mark.parametrize("N", [128, 1024])
99 -@pytest.mark.parametrize("dtype", [torch.float8_e4m3fn, torch.bfloat16])
104 +@pytest.mark.parametrize("dtype", DTYPES)
105 @pytest.mark.parametrize("block_shape", [None, [128, 128]])
106 @pytest.mark.parametrize("per_act_token_quant", [False, True])
107 def test_batched_mm(
@@ -229,7 +234,7 @@ def test_batched_mm(
234 @pytest.mark.parametrize(("m", "n", "k"), MNK_FACTORS)
235 @pytest.mark.parametrize("e", NUM_EXPERTS)
236 @pytest.mark.parametrize("topk", TOP_KS)
232 -@pytest.mark.parametrize("dtype", [torch.float8_e4m3fn, torch.bfloat16])
237 +@pytest.mark.parametrize("dtype", DTYPES)
238 @pytest.mark.parametrize("per_act_token_quant", [False, True])
239 @pytest.mark.parametrize("block_shape", [None, [128, 128]])
240 @pytest.mark.parametrize("input_scales", [False])
tests/kernels/moe/test_block_fp8.py
+5
@@ -31,6 +31,11 @@ dg_available = has_deep_gemm()
31
32 if current_platform.get_device_capability() < (9, 0):
33 pytest.skip("FP8 Triton requires CUDA 9.0 or higher", allow_module_level=True)
34 +if current_platform.is_fp8_fnuz():
35 + pytest.skip(
36 + "Tests in this file require float8_e4m3fn and platform does not support",
37 + allow_module_level=True,
38 + )
39
40 vllm_config = VllmConfig()
41
tests/kernels/moe/test_gpt_oss_triton_kernels.py
+5
@@ -270,6 +270,11 @@ class Case:
270 @pytest.mark.parametrize("num_token", [2])
271 @pytest.mark.parametrize("tp", [1, 2, 4, 8])
272 def test_equiv(num_token, a_dtype, w_dtype, tp):
273 + from triton_kernels.tensor_details import layout
274 +
275 + if not hasattr(layout, "make_default_matmul_mxfp4_w_layout"):
276 + pytest.skip("make_default_matmul_mxfp4_w_layout not available")
277 +
278 M = num_token
279 E = ModelConfig.num_experts
280 K = ModelConfig.hidden_size
tests/kernels/moe/test_modular_kernel_combinations.py
+6
@@ -46,6 +46,12 @@ meets_multi_gpu_requirements = pytest.mark.skipif(
46 reason="Requires deep_ep or deep_gemm or pplx or flashinfer packages",
47 )
48
49 +if current_platform.is_fp8_fnuz():
50 + pytest.skip(
51 + "Tests in this file require float8_e4m3fn and platform does not support",
52 + allow_module_level=True,
53 + )
54 +
55
56 def format_result(verbose, msg, ex=None):
57 if ex is not None:
tests/kernels/moe/test_moe_permute_unpermute.py
+6
@@ -23,6 +23,12 @@ TOP_KS = [2, 6, 8]
23 EP_SIZE = [1, 4, 16]
24 current_platform.seed_everything(0)
25
26 +if current_platform.is_rocm():
27 + pytest.skip(
28 + "moe_permute_unpermute_supported is not defined for ROCm",
29 + allow_module_level=True,
30 + )
31 +
32
33 def torch_permute(
34 hidden_states: torch.Tensor,
tests/kernels/moe/test_silu_mul_fp8_quant_deep_gemm.py
+6
@@ -14,6 +14,12 @@ from vllm.platforms import current_platform
14 from vllm.utils.deep_gemm import DeepGemmQuantScaleFMT, has_deep_gemm
15 from vllm.utils.math_utils import cdiv, round_up
16
17 +if current_platform.is_fp8_fnuz():
18 + pytest.skip(
19 + "Tests in this file require float8_e4m3fn and platform does not support",
20 + allow_module_level=True,
21 + )
22 +
23 fp8_dtype = torch.float8_e4m3fn
24
25 CASES = [
tests/kernels/moe/test_triton_moe_ptpc_fp8.py
+6
@@ -19,6 +19,12 @@ if current_platform.get_device_capability() < (9, 0):
19
20 vllm_config = VllmConfig()
21
22 +if current_platform.is_fp8_fnuz():
23 + pytest.skip(
24 + "Tests in this file require float8_e4m3fn and platform does not support",
25 + allow_module_level=True,
26 + )
27 +
28
29 def native_w8a8_per_token_matmul(A, B, As, Bs, output_dtype=torch.float16):
30 """Matrix multiplication function that supports per-token input