MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / __init__

Method __init__

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

Source from the content-addressed store, hash-verified

743class PartitionedTensor:
744
745 def __init__(self, tensor, group, partition_meta=None):
746 super().__init__()
747
748 self.group = group
749 self.num_parts = dist.get_world_size(group=self.group)
750 self.rank = dist.get_rank(group=self.group)
751 self.orig_size = list(tensor.size())
752 self.orig_device = tensor.device
753 self.local_data, self.partition = self._partition_tensor(tensor)
754 self.even_split = tensor.numel() % self.num_parts == 0
755
756 @classmethod
757 def from_meta(cls, meta, local_part, group, device=get_accelerator().device_name()):

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected