Skip to content

Commit

Permalink
FIX the document of distributed.new_group() (pytorch#122703)
Browse files Browse the repository at this point in the history
As for now, the document of distributed.new_group() says that it returns `None` when current ranks is not in the new created process group. However, it actually returns `GroupMember.NON_GROUP_MEMBER`. I have check the code and think it is more appropriate that we fix the document.

Pull Request resolved: pytorch#122703
Approved by: https://github.com/wconstab, https://github.com/kwen2501
  • Loading branch information
Raphael-Hao authored and Aidyn-A committed May 30, 2024
1 parent 5ed1dc8 commit e1dcb49
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion torch/distributed/distributed_c10d.py
Original file line number Diff line number Diff line change
Expand Up @@ -4100,7 +4100,8 @@ def new_group(ranks=None, timeout=None, backend=None, pg_options=None, use_local
group_desc (str, optional): a string to describe the process group.
Returns:
A handle of distributed group that can be given to collective calls or None if the rank is not part of ``ranks``.
A handle of distributed group that can be given to collective calls or
GroupMember.NON_GROUP_MEMBER if the rank is not part of ``ranks``.
N.B. use_local_synchronization doesn't work with MPI.
Expand Down

0 comments on commit e1dcb49

Please sign in to comment.