Skip to content

Commit 4a79049

Browse files
committed
Update on "[C10D] Support group ranks in P2POp and batch_isend_irecv"
Changes semantic of __repr__ of P2POp: s, d are now group ranks instead of global ranks. I think this is OK since I also updated the field names to make this obvious. Also add mypy annotations Partially addresses RFC 0042 (pytorch/rfcs#71) See more details/motivation in #140460 cc H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 d4l3k c-p-i-o [ghstack-poisoned]
1 parent a5b421c commit 4a79049

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch/distributed/distributed_c10d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,10 +488,10 @@ def __init__(
488488
"""Init."""
489489
self.op = op
490490
self.tensor = tensor
491+
self.group = _group_or_default_group(group)
491492
self.peer = _canonicalize_group_rank(
492493
self.group, peer, group_peer, return_global=True
493494
)
494-
self.group = _group_or_default_group(group)
495495
self.tag = tag
496496
self.group_peer = _canonicalize_group_rank(self.group, peer, group_peer)
497497

0 commit comments

Comments
 (0)