MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / __init__

Method __init__

deepspeed/runtime/utils.py:623–632  ·  view source on GitHub ↗
(self, tensor, group, partition_meta=None)

Source from the content-addressed store, hash-verified

621class PartitionedTensor:
622
623 def __init__(self, tensor, group, partition_meta=None):
624 super().__init__()
625
626 self.group = group
627 self.num_parts = dist.get_world_size(group=self.group)
628 self.rank = dist.get_rank(group=self.group)
629
630 self.orig_size = list(tensor.size())
631 self.orig_device = tensor.device
632 self.local_data, self.partition = self._partition_tensor(tensor)
633
634 @classmethod
635 def from_meta(cls, meta, local_part, group, device=get_accelerator().device_name()):

Callers

nothing calls this directly

Calls 5

_partition_tensorMethod · 0.95
get_world_sizeMethod · 0.80
__init__Method · 0.45
get_rankMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected