[Test] Skip DeepEP MoE layer tests without P2P access (#47946)
Signed-off-by: Tyler Michael Smith <tyler@tylermsmith.com> Signed-off-by: Tyler Michael Smith <tlrmchlsmth@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>
Tyler Michael Smith committed
Jul 8, 2026 at 04:46 UTC
99a85617bf4e65ef0ddd4241fa2d4b637fe5106a
1 file changed
+24
tests/kernels/moe/test_moe_layer.py
+24
@@ -36,6 +36,9 @@ from vllm.distributed import (
36
get_eplb_group,
37
tensor_model_parallel_all_gather,
38
)
39
+from vllm.distributed.device_communicators.all_reduce_utils import (
40
+ gpu_p2p_access_check,
41
+)
42
from vllm.distributed.eplb.eplb_communicator import create_eplb_communicator
43
from vllm.distributed.eplb.rebalance_execute import rearrange_expert_weights_inplace
44
from vllm.forward_context import set_forward_context
@@ -106,6 +109,8 @@ if has_deep_ep():
109
if has_nixl_ep():
110
BACKENDS += ["nixl_ep"]
111
112
+DEEPEP_BACKENDS = {"deepep_high_throughput", "deepep_low_latency"}
113
+
114
QUANT_METHODS = [
115
None,
116
"fp8",
@@ -416,6 +421,22 @@ def generate_valid_test_configs(
421
return configs
422
423
424
+@functools.cache
425
+def visible_devices_have_peer_access(world_size: int) -> bool:
426
+ if not current_platform.is_cuda():
427
+ return True
428
+
429
+ try:
430
+ return all(
431
+ gpu_p2p_access_check(src, dst)
432
+ for src in range(world_size)
433
+ for dst in range(world_size)
434
+ if src != dst
435
+ )
436
+ except RuntimeError:
437
+ return False
438
+
439
+
440
# TODO: break this up into sections
441
def is_valid_config(config: MoETestConfig) -> tuple[bool, str | None]:
442
# routed_input_transform only makes sense with shared_experts (latent MoE)
@@ -1802,6 +1823,9 @@ def test_moe_layer(
1823
if enable_eplb and not use_ep:
1824
pytest.skip("EPLB requires EP.")
1825
1826
+ if backend in DEEPEP_BACKENDS and not visible_devices_have_peer_access(world_size):
1827
+ pytest.skip("DeepEP backends require peer access between visible GPUs.")
1828
+
1829
verbosity = pytestconfig.getoption("verbose")
1830
1831
if os.environ.get("VLLM_LOGGING_LEVEL") is None: