MCPcopy
hub / github.com/hpcaitech/ColossalAI / size

Method size

colossalai/cluster/process_group_mesh.py:83–95  ·  view source on GitHub ↗

Get the size of the process group mesh. Args: dim (Optional[int], optional): Dimension of the process group mesh. `None` means all dimensions. Defaults to None. Returns: Union[int, Tuple[int, ...]]: Size of the target dimension or the whole process group mes

(self, dim: Optional[int] = None)

Source from the content-addressed store, hash-verified

81 return self._rank
82
83 def size(self, dim: Optional[int] = None) -> Union[int, Tuple[int, ...]]:
84 """Get the size of the process group mesh.
85
86 Args:
87 dim (Optional[int], optional): Dimension of the process group mesh. `None` means all dimensions. Defaults to None.
88
89 Returns:
90 Union[int, Tuple[int, ...]]: Size of the target dimension or the whole process group mesh.
91 """
92 if dim is None:
93 return self._shape
94 else:
95 return self._shape[dim]
96
97 def coordinate(self, dim: Optional[int] = None) -> Union[int, Tuple[int, ...]]:
98 """Get the coordinate of the process group mesh.

Callers 15

mainFunction · 0.95
test_overfitFunction · 0.45
generation_wrapperFunction · 0.45
generate_no_streamFunction · 0.45
_training_stepMethod · 0.45
generateMethod · 0.45
training_stepMethod · 0.45
__call__Method · 0.45

Calls

no outgoing calls

Tested by 15

test_overfitFunction · 0.36
forwardMethod · 0.36
test_coloproxyFunction · 0.36
attention_refFunction · 0.36
forwardMethod · 0.36
forwardMethod · 0.36
test_fp8_castFunction · 0.36
check_memFunction · 0.36
test_drafterFunction · 0.36
check_spec_decFunction · 0.36
test_copy_kv_to_cachesFunction · 0.36