Skip to content

Commit fc983a4

Browse files
committed
support optim cases
1 parent 0f21fa8 commit fc983a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torch/distributed/algorithms/ddp_comm_hooks/ddp_zero_hook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def hook_with_zero_step(
235235
# NOTE: Gloo may hang with this overlapping approach, so we require
236236
# NCCL/HCCL backend for now; see https://github.com/pytorch/pytorch/issues/62300
237237
pg = dist.get_backend(ddp_ref().process_group) # type: ignore[union-attr]
238-
if (pg != dist.Backend.NCCL) and (pg != "hccl"):
238+
if (pg != dist.Backend.NCCL) and (pg != "hccl") and (pg != "xccl"):
239239
raise RuntimeError(
240240
"Overlapping DDP with ZeRO using this approach currently requires "
241241
"NCCL/HCCL backend to avoid hangs"
@@ -397,7 +397,7 @@ def hook_with_zero_step_interleaved(
397397
# NOTE: Gloo may hang with this overlapping approach, so we require
398398
# NCCL/HCCL backend for now; see https://github.com/pytorch/pytorch/issues/62300
399399
pg = dist.get_backend(ddp_ref().process_group) # type: ignore[union-attr]
400-
if (pg != dist.Backend.NCCL) and (pg != "hccl"):
400+
if (pg != dist.Backend.NCCL) and (pg != "hccl") and (pg != "xccl"):
401401
raise RuntimeError(
402402
"Overlapping DDP with ZeRO using this approach currently requires "
403403
"NCCL/HCCL backend to avoid hangs"

0 commit comments

Comments
 (0)