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

Function _get_data_parallel_group

deepspeed/utils/groups.py:786–799  ·  view source on GitHub ↗

Get the data parallel group the caller rank belongs to.

()

Source from the content-addressed store, hash-verified

784
785
786def _get_data_parallel_group():
787 """Get the data parallel group the caller rank belongs to."""
788 assert dist.is_initialized(), 'dist is not initialized'
789 global mpu
790 if mesh_device is not None:
791 return mesh_device.get_group(mesh_dim="data_parallel")
792 if mpu is not None:
793 if hasattr(mpu, 'initialize_sequence_parallel'):
794 return None
795 else:
796 return mpu.get_data_parallel_group()
797
798 # Return the clone of dist world group
799 return _clone_world_group()
800
801
802def _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