From 50239dfc4d10f007887f2cbc042809e3f4c2ceeb Mon Sep 17 00:00:00 2001 From: Tyler Michael Smith Date: Tue, 29 Sep 2026 18:36:30 -0400 Subject: [PATCH] [WideEP] Change DeepEPv2 to auto select hybrid mode by default (#57991) Signed-off-by: Tyler Michael Smith Co-authored-by: Codex --- vllm/distributed/device_communicators/all2all.py | 4 +++- vllm/envs.py | 8 ++++++-- vllm/utils/nccl.py | 8 +++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/vllm/distributed/device_communicators/all2all.py b/vllm/distributed/device_communicators/all2all.py index 21a1f00da4..5f339540b4 100644 --- a/vllm/distributed/device_communicators/all2all.py +++ b/vllm/distributed/device_communicators/all2all.py @@ -1065,7 +1065,9 @@ class DeepEPV2All2AllManager(All2AllManagerBase): if os.environ.get("EP_DISABLE_GIN", "0") != "0": return - gin_type = query_nccl_gin_type(group) + gin_type = query_nccl_gin_type( + group, railed=envs.VLLM_DEEPEP_V2_ALLOW_HYBRID_MODE + ) if gin_type is None: raise RuntimeError( "DeepEPv2 communicator properties query failed; " diff --git a/vllm/envs.py b/vllm/envs.py index c8e1a8b708..428d6d3c94 100755 --- a/vllm/envs.py +++ b/vllm/envs.py @@ -2009,9 +2009,13 @@ environment_variables: dict[str, Callable[[], Any]] = { "VLLM_DEEPEP_LOW_LATENCY_USE_MNNVL": lambda: bool( int(os.getenv("VLLM_DEEPEP_LOW_LATENCY_USE_MNNVL", "0")) ), - # DeepEP v2: enable two-tier NVLink+RDMA hybrid mode + # DeepEP v2: use NVLink+RDMA hybrid communication across NVLink domains. + # * hybrid mode = multi-node RDMA + # * non hybrid mode = nvlink + # Set to 1 (the default) to allow DeepEP to autoselect hybrid vs non-hybrid. + # Set to 0 to disable hybrid mode. "VLLM_DEEPEP_V2_ALLOW_HYBRID_MODE": lambda: bool( - int(os.getenv("VLLM_DEEPEP_V2_ALLOW_HYBRID_MODE", "0")) + int(os.getenv("VLLM_DEEPEP_V2_ALLOW_HYBRID_MODE", "1")) ), # DeepEP v2: use fewer SMs at slight throughput cost "VLLM_DEEPEP_V2_PREFER_OVERLAP": lambda: bool( diff --git a/vllm/utils/nccl.py b/vllm/utils/nccl.py index 5a033f1852..90064d4184 100644 --- a/vllm/utils/nccl.py +++ b/vllm/utils/nccl.py @@ -83,8 +83,10 @@ def find_nccl_library_paths() -> list[str] | None: return paths or None -def query_nccl_gin_type(group: torch.distributed.ProcessGroup) -> int | None: - """Return the GIN type for an initialized group, or ``None`` on failure.""" +def query_nccl_gin_type( + group: torch.distributed.ProcessGroup, *, railed: bool = False +) -> int | None: + """Return the full or railed GIN type, or ``None`` on query failure.""" from vllm.distributed.device_communicators.pynccl_wrapper import ( NCCL_COMM_PROPERTIES_LAYOUT_VERSION, NCCLLibrary, @@ -126,4 +128,4 @@ def query_nccl_gin_type(group: torch.distributed.ProcessGroup) -> int | None: if result != 0: logger.warning("ncclCommQueryProperties returned error %d", result) return None - return props.ginType + return props.railedGinType if railed else props.ginType