[Distributed] Propagate semantic group names to PyTorch process groups (#32900)
Co-authored-by: jipengtian <jipengtian@xiaohongshu.com> Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
jipengtian
Claude
parent
c54dc4582f
commit
f9e6888b5a
@@ -348,12 +348,14 @@ class GroupCoordinator:
|
||||
backend="mooncake",
|
||||
pg_options=dev_opts,
|
||||
timeout=subgroup_timeout,
|
||||
group_desc=f"{group_name}:device",
|
||||
)
|
||||
cpu_group = torch.distributed.new_group(
|
||||
ranks,
|
||||
backend="mooncake-cpu",
|
||||
pg_options=cpu_opts,
|
||||
timeout=subgroup_timeout,
|
||||
group_desc=f"{group_name}:cpu",
|
||||
)
|
||||
else:
|
||||
active_ranks = torch.ones(
|
||||
@@ -366,11 +368,15 @@ class GroupCoordinator:
|
||||
backend=torch_distributed_backend,
|
||||
pg_options=pg_options,
|
||||
timeout=subgroup_timeout,
|
||||
group_desc=f"{group_name}:device",
|
||||
)
|
||||
# a group with `gloo` backend, to allow direct coordination
|
||||
# between processes through the CPU.
|
||||
cpu_group = torch.distributed.new_group(
|
||||
ranks, backend="gloo", timeout=gloo_timeout
|
||||
ranks,
|
||||
backend="gloo",
|
||||
timeout=gloo_timeout,
|
||||
group_desc=f"{group_name}:cpu",
|
||||
)
|
||||
if self.rank in ranks:
|
||||
self.ranks = ranks
|
||||
|
||||
Reference in New Issue
Block a user