Fix error due to CustomAllreduce setup failure (#4815)

Signed-off-by: Kebe <mail@kebe7jun.com>
This commit is contained in:
Kebe
2025-03-28 09:52:10 +08:00
committed by GitHub
parent bb0fd749a6
commit 10a9ab7b07

View File

@@ -264,10 +264,16 @@ class GroupCoordinator:
self.ca_comm: Optional[CustomAllreduce] = None
if use_custom_allreduce and self.world_size > 1:
# Initialize a custom fast all-reduce implementation.
self.ca_comm = CustomAllreduce(
group=self.cpu_group,
device=self.device,
)
try:
self.ca_comm = CustomAllreduce(
group=self.cpu_group,
device=self.device,
)
except Exception as e:
logger.warning(
f"Setup Custom allreduce failed with {e}. To silence this "
"warning, specify --disable-custom-all-reduce explicitly."
)
from sglang.srt.distributed.device_communicators.hpu_communicator import (
HpuCommunicator,