MCPcopy
hub / github.com/deepspeedai/DeepSpeed / _get_data_parallel_group

Function _get_data_parallel_group

deepspeed/utils/groups.py:614–627  ·  view source on GitHub ↗

Get the data parallel group the caller rank belongs to.

()

Source from the content-addressed store, hash-verified

612
613
614def _get_data_parallel_group():
615 """Get the data parallel group the caller rank belongs to."""
616 assert dist.is_initialized(), 'dist is not initialized'
617 global mpu
618 if mesh_device is not None:
619 return mesh_device.get_group(mesh_dim="data_parallel")
620 if mpu is not None:
621 if hasattr(mpu, 'initialize_sequence_parallel'):
622 return None
623 else:
624 return mpu.get_data_parallel_group()
625
626 # Return the clone of dist world group
627 return _clone_world_group()
628
629
630def _get_data_parallel_group_ranks():

Callers 3

_get_data_parallel_rankFunction · 0.85

Calls 3

_clone_world_groupFunction · 0.85
is_initializedMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…