MCPcopy Create free account
hub / github.com/THUDM/GLM / get_model_parallel_src_rank

Function get_model_parallel_src_rank

mpu/initialize.py:112–117  ·  view source on GitHub ↗

Calculate the global rank corresponding to a local rank zeor in the model parallel group.

()

Source from the content-addressed store, hash-verified

110
111
112def get_model_parallel_src_rank():
113 """Calculate the global rank corresponding to a local rank zeor
114 in the model parallel group."""
115 global_rank = torch.distributed.get_rank()
116 local_world_size = get_model_parallel_world_size()
117 return (global_rank // local_world_size) * local_world_size
118
119
120def get_data_parallel_world_size():

Callers 2

broadcast_dataFunction · 0.85

Calls 1

Tested by

no test coverage detected