From 99a85617bf4e65ef0ddd4241fa2d4b637fe5106a Mon Sep 17 00:00:00 2001 From: Tyler Michael Smith Date: Wed, 8 Jul 2026 04:46:03 -0400 Subject: [PATCH] [Test] Skip DeepEP MoE layer tests without P2P access (#47946) Signed-off-by: Tyler Michael Smith Signed-off-by: Tyler Michael Smith Co-authored-by: Claude --- tests/kernels/moe/test_moe_layer.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/kernels/moe/test_moe_layer.py b/tests/kernels/moe/test_moe_layer.py index 552063988fa..cc8d9c36dc0 100644 --- a/tests/kernels/moe/test_moe_layer.py +++ b/tests/kernels/moe/test_moe_layer.py @@ -36,6 +36,9 @@ from vllm.distributed import ( get_eplb_group, tensor_model_parallel_all_gather, ) +from vllm.distributed.device_communicators.all_reduce_utils import ( + gpu_p2p_access_check, +) from vllm.distributed.eplb.eplb_communicator import create_eplb_communicator from vllm.distributed.eplb.rebalance_execute import rearrange_expert_weights_inplace from vllm.forward_context import set_forward_context @@ -106,6 +109,8 @@ if has_deep_ep(): if has_nixl_ep(): BACKENDS += ["nixl_ep"] +DEEPEP_BACKENDS = {"deepep_high_throughput", "deepep_low_latency"} + QUANT_METHODS = [ None, "fp8", @@ -416,6 +421,22 @@ def generate_valid_test_configs( return configs +@functools.cache +def visible_devices_have_peer_access(world_size: int) -> bool: + if not current_platform.is_cuda(): + return True + + try: + return all( + gpu_p2p_access_check(src, dst) + for src in range(world_size) + for dst in range(world_size) + if src != dst + ) + except RuntimeError: + return False + + # TODO: break this up into sections def is_valid_config(config: MoETestConfig) -> tuple[bool, str | None]: # routed_input_transform only makes sense with shared_experts (latent MoE) @@ -1802,6 +1823,9 @@ def test_moe_layer( if enable_eplb and not use_ep: pytest.skip("EPLB requires EP.") + if backend in DEEPEP_BACKENDS and not visible_devices_have_peer_access(world_size): + pytest.skip("DeepEP backends require peer access between visible GPUs.") + verbosity = pytestconfig.getoption("verbose") if os.environ.get("VLLM_LOGGING_LEVEL") is None: