Commit a207db1d authored by yuguo's avatar yuguo
Browse files
parents fbee8990 69365f88
......@@ -411,3 +411,16 @@ def nvtx_range_pop(msg: Optional[str] = None) -> None:
# Pop NVTX range
torch.cuda.nvtx.range_pop()
def canonicalize_process_group(
group: Optional[torch.distributed.ProcessGroup],
) -> torch.distributed.ProcessGroup:
"""Convert to PyTorch process group
If `None`, returns default process group.
"""
if group is None:
return torch.distributed.distributed_c10d._get_default_group()
return group
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment