[XPU] Enable XPU eplb (#44987)

Signed-off-by: mayuyuace <qiming1.zhang@intel.com>
Signed-off-by: Qiming Zhang <qiming1.zhang@intel.com>
This commit is contained in:
Qiming Zhang
2026-09-17 13:19:13 +08:00
committed by GitHub
parent 2743dc4f92
commit e6b1a5e5e3
16 changed files with 267 additions and 109 deletions
+12 -5
View File
@@ -38,7 +38,9 @@ DistributedExecutorBackend = Literal["ray", "mp", "uni", "external_launcher"]
DataParallelBackend = Literal["ray", "mp"]
EPLBPolicyOption = Literal["default"]
DCPCommBackend = Literal["ag_rs", "a2a"]
EPLBCommunicatorBackend = Literal["torch_nccl", "torch_gloo", "nixl", "pynccl"]
EPLBCommunicatorBackend = Literal[
"torch_nccl", "torch_gloo", "torch_xccl", "nixl", "pynccl"
]
All2AllBackend = Literal[
"naive",
"pplx",
@@ -94,9 +96,11 @@ class EPLBConfig:
Backend for EPLB expert weight communication:
- "torch_nccl": Use torch.distributed on the device process group
- "torch_gloo": Use torch.distributed gloo with CPU staging
- "torch_xccl": Use torch.distributed XCCL device P2P on XPU
- "nixl": Use NIXL with staged send/recv buffers
- "pynccl": Use PyNccl send/recv
- None: Auto-select backend (prefers "nixl", falls back to "torch_gloo")
- None: Auto-select backend ("torch_xccl" on XPU, prefers "nixl"
on CUDA, falls back to "torch_gloo")
"""
@model_validator(mode="after")
@@ -525,10 +529,10 @@ class ParallelConfig:
)
if self.enable_eplb:
if not current_platform.is_cuda_alike():
if not current_platform.is_cuda_alike() and not current_platform.is_xpu():
raise ValueError(
"Expert parallelism load balancing is only supported on "
"CUDA devices or ROCm devices now."
"CUDA devices or ROCm devices or XPU devices now."
)
if not self.enable_expert_parallel:
raise ValueError("enable_expert_parallel must be True to use EPLB.")
@@ -1034,7 +1038,10 @@ class ParallelConfig:
# See https://github.com/pytorch/pytorch/issues/174288
from vllm.distributed.nixl_utils import is_nixl_available
if is_nixl_available():
if current_platform.is_xpu():
# On XPU, use the device-native XCCL P2P backend.
self.eplb_config.communicator = "torch_xccl"
elif is_nixl_available():
self.eplb_config.communicator = "nixl"
elif self.enable_elastic_ep:
self.eplb_config.communicator = "pynccl"