Add interface for colo tesnor dp size (#3227)

This commit is contained in:
YH
2023-03-27 10:42:21 +09:00
committed by GitHub
parent 1653063fce
commit 1a229045af
2 changed files with 10 additions and 1 deletions

View File

@@ -138,6 +138,15 @@ class ColoTensor(torch.Tensor):
def get_tp_world_size(self) -> int:
return self.process_group.tp_world_size()
def get_dp_world_size(self) -> int:
"""get_dp_world_size
get the dp world size of the tensor.
Returns:
int: dp world size
"""
return self.process_group.dp_world_size()
def set_dist_spec(self, dist_spec: _DistSpec):
"""set_dist_spec
set dist spec and change the payloads.