Unverified Commit 7de45db9 authored by Ning Xie's avatar Ning Xie Committed by GitHub
Browse files

[Misc] update doc comment for send (#22026)


Signed-off-by: default avatarAndy Xie <andy.xning@gmail.com>
parent 789562c2
...@@ -219,7 +219,7 @@ class DeviceCommunicatorBase: ...@@ -219,7 +219,7 @@ class DeviceCommunicatorBase:
return output_tensor return output_tensor
def send(self, tensor: torch.Tensor, dst: Optional[int] = None) -> None: def send(self, tensor: torch.Tensor, dst: Optional[int] = None) -> None:
"""Sends a tensor to the destination rank in a non-blocking way""" """Sends a tensor to the destination rank in a blocking way"""
"""NOTE: `dst` is the local rank of the destination rank.""" """NOTE: `dst` is the local rank of the destination rank."""
if dst is None: if dst is None:
dst = (self.rank_in_group + 1) % self.world_size dst = (self.rank_in_group + 1) % self.world_size
......
...@@ -179,7 +179,7 @@ class CudaCommunicator(DeviceCommunicatorBase): ...@@ -179,7 +179,7 @@ class CudaCommunicator(DeviceCommunicatorBase):
return output.movedim(0, dim).contiguous() return output.movedim(0, dim).contiguous()
def send(self, tensor: torch.Tensor, dst: Optional[int] = None) -> None: def send(self, tensor: torch.Tensor, dst: Optional[int] = None) -> None:
"""Sends a tensor to the destination rank in a non-blocking way""" """Sends a tensor to the destination rank in a blocking way"""
"""NOTE: `dst` is the local rank of the destination rank.""" """NOTE: `dst` is the local rank of the destination rank."""
if dst is None: if dst is None:
dst = (self.rank_in_group + 1) % self.world_size dst = (self.rank_in_group + 1) % self.world_size
......
...@@ -782,7 +782,7 @@ class GroupCoordinator: ...@@ -782,7 +782,7 @@ class GroupCoordinator:
torch.distributed.barrier(group=self.cpu_group) torch.distributed.barrier(group=self.cpu_group)
def send(self, tensor: torch.Tensor, dst: Optional[int] = None) -> None: def send(self, tensor: torch.Tensor, dst: Optional[int] = None) -> None:
"""Sends a tensor to the destination rank in a non-blocking way""" """Sends a tensor to the destination rank in a blocking way"""
"""NOTE: `dst` is the local rank of the destination rank.""" """NOTE: `dst` is the local rank of the destination rank."""
self.device_communicator.send(tensor, dst) self.device_communicator.send(tensor, dst)
......
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