MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / get_node_src_rank

Function get_node_src_rank

SwissArmyTransformer/sat/mpu/initialize.py:158–163  ·  view source on GitHub ↗

Calculate the global rank corresponding to a local rank zero in the node group.

()

Source from the content-addressed store, hash-verified

156
157
158def get_node_src_rank():
159 """Calculate the global rank corresponding to a local rank zero
160 in the node group."""
161 global_rank = torch.distributed.get_rank()
162 local_world_size = get_node_world_size()
163 return (global_rank // local_world_size) * local_world_size
164
165
166def get_data_parallel_world_size():

Callers 2

mp_split_model_rank0Function · 0.85
mp_split_model_receiveFunction · 0.85

Calls 1

get_node_world_sizeFunction · 0.85

Tested by

no test coverage detected