Get the data parallel group the caller rank belongs to.
()
| 784 | |
| 785 | |
| 786 | def _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 | |
| 802 | def _get_data_parallel_group_ranks(): |
no test coverage detected