[ROCm][CI] Fix Kernels and Kernels attention test failures (#47519)

Signed-off-by: Carl Persson <carl.persson@amd.com>

Carl Persson committed Jul 4, 2026 at 22:59 UTC 4a6bf3c77f05b398b46fe4207ea1ee715d56c64f
2 files changed +11 -2
tests/kernels/attention/test_rocm_aiter_mla_decode_metadata.py
+1 -1
@@ -113,7 +113,7 @@ def _build_decode_metadata():
113 # stub with the attribute is enough for metadata construction.
114 layer_name = "placeholder"
115 vllm_config.compilation_config.static_forward_context[layer_name] = (
116 - types.SimpleNamespace(prefill_backend=None)
116 + types.SimpleNamespace(prefill_backend=torch.empty((1,)))
117 )
118
119 init_workspace_manager(device)
tests/kernels/moe/test_ocp_mx_moe.py
+10 -1
@@ -2,6 +2,7 @@
2 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4 import importlib.metadata
5 +import types
6 from dataclasses import dataclass
7 from importlib.util import find_spec
8
@@ -10,7 +11,7 @@ import torch
11 from packaging import version
12
13 from tests.kernels.moe.utils import check_accuracy
13 -from vllm._aiter_ops import is_aiter_found
14 +from vllm._aiter_ops import is_aiter_found, rocm_aiter_ops
15 from vllm.platforms import current_platform
16 from vllm.utils.flashinfer import has_flashinfer
17
@@ -1247,6 +1248,7 @@ def test_rocm_mxfp4_moe_oracle(
1248 num_tokens: int,
1249 hidden_size: int,
1250 intermediate_size: int,
1251 + monkeypatch: pytest.MonkeyPatch,
1252 ):
1253 """
1254 Test ROCm MXFP4 MoE using oracle functions.
@@ -1268,6 +1270,7 @@ def test_rocm_mxfp4_moe_oracle(
1270 if config["requires_gfx950"] and not ROCM_GFX950:
1271 pytest.skip(f"Backend {backend_name} requires GFX950")
1272
1273 + import vllm.distributed.parallel_state as ps
1274 from vllm.config import VllmConfig, set_current_vllm_config
1275 from vllm.model_executor.layers.fused_moe.activation import MoEActivation
1276 from vllm.model_executor.layers.fused_moe.oracle.mxfp4 import (
@@ -1282,6 +1285,12 @@ def test_rocm_mxfp4_moe_oracle(
1285 # Initialize workspace manager (needed for modular kernels)
1286 init_workspace_manager(torch.accelerator.current_device_index())
1287
1288 + # Set up the TP Group to prevent failure on should_use_cdna4_mx_scale_swizzle check
1289 + monkeypatch.setattr(ps, "_TP", types.SimpleNamespace(world_size=1))
1290 +
1291 + # AITER must be enabled or aiter_mxfp4_w4a8_moe asserts before dispatch.
1292 + monkeypatch.setattr(rocm_aiter_ops, "_AITER_ENABLED", True)
1293 +
1294 # Map string to enum
1295 backend = Mxfp4MoeBackend[backend_name]
1296