Skip to content

Commit 43aca95

Browse files
committed
test: skip AITER batched experts before ROCm imports
Signed-off-by: Chaemin Lim <chaemin.lim@mangoboost.io> Signed-off-by: Edwin Lim <edwin.lim@mangoboost.io>
1 parent cdca01d commit 43aca95

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

tests/kernels/moe/test_aiter_batched_experts.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# SPDX-License-Identifier: Apache-2.0
22
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3+
# ruff: noqa: E402, I001
34
"""Unit-level tests for the AITER ``BatchedExperts`` FP8 wrapper.
45
56
These tests guard reshape and oracle-selection contracts without invoking
@@ -18,9 +19,24 @@
1819
from types import SimpleNamespace
1920

2021
import pytest
21-
import torch
22+
23+
from vllm.platforms import current_platform
24+
25+
if not current_platform.is_rocm():
26+
pytest.skip(
27+
"AITER BatchedExperts tests require ROCm.",
28+
allow_module_level=True,
29+
)
2230

2331
from vllm._aiter_ops import is_aiter_found_and_supported
32+
33+
if not is_aiter_found_and_supported():
34+
pytest.skip(
35+
"AITER BatchedExperts tests require supported ROCm AITER.",
36+
allow_module_level=True,
37+
)
38+
39+
import torch # noqa: E402
2440
from vllm.model_executor.layers.fused_moe import modular_kernel as mk
2541
from vllm.model_executor.layers.fused_moe.activation import MoEActivation
2642
from vllm.model_executor.layers.fused_moe.config import (
@@ -42,11 +58,6 @@
4258
select_fp8_moe_backend,
4359
)
4460

45-
pytestmark = pytest.mark.skipif(
46-
not is_aiter_found_and_supported(),
47-
reason="AITER BatchedExperts tests require supported ROCm AITER.",
48-
)
49-
5061

5162
def _make_moe_config(
5263
*,

0 commit comments

Comments
 (0)