mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-09 04:50:17 +00:00
[refactor] remove gpc dependency in colotensor's _ops (#1189)
This commit is contained in:
@@ -78,6 +78,12 @@ class ColoTensor(torch.Tensor):
|
||||
def is_model_data(self) -> bool:
|
||||
return self._type == TensorType.MODEL
|
||||
|
||||
def get_process_group(self) -> 'ProcessGroup':
|
||||
return self._tensor_spec.dist_spec.process_group
|
||||
|
||||
def get_tp_world_size(self) -> int:
|
||||
return self._tensor_spec.dist_spec.process_group.tp_world_size()
|
||||
|
||||
@classmethod
|
||||
def __torch_function__(cls, func, types, args=(), kwargs=None):
|
||||
if kwargs is None:
|
||||
|
Reference in New Issue
Block a user