Skip to content

Commit

Permalink
finalize
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Chenjim Wang committed Feb 20, 2025
1 parent f6f89c3 commit 9cf9554
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions torchft/process_group_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,17 +705,16 @@ def tearDownClass(cls) -> None:
def _create_pg(cls, backend: str) -> ProcessGroup:
"""
Helper that creates a new ProcessGroup of the specified type.
We replicate the logic from the original test_* methods to decide how to
instantiate Gloo, NCCL, or Baby versions, etc.
NCCL groups aren't currently supported - we prefer to test
BabyNCCLGroups as they spin up their own subprocesses.
"""
if backend == "gloo":
return ProcessGroupGloo(timeout=timedelta(seconds=2))
elif backend == "nccl":
return ProcessGroupNCCL()
return ProcessGroupGloo(timeout=timedelta(seconds=1))
elif backend == "baby_gloo":
return ProcessGroupBabyGloo(timeout=timedelta(seconds=2))
elif backend == "baby_nccl":
return ProcessGroupBabyNCCL(timeout=timedelta(seconds=5))
return ProcessGroupBabyNCCL(timeout=timedelta(seconds=10))
else:
# fallback / dummy
return ProcessGroupDummy(0, 1)
Expand Down

0 comments on commit 9cf9554

Please sign in to comment.