()
| 53 | |
| 54 | |
| 55 | def get_context_parallel_rank(): |
| 56 | assert _CONTEXT_PARALLEL_SIZE is not None, "context parallel size is not initialized" |
| 57 | |
| 58 | rank = torch.distributed.get_rank() |
| 59 | cp_rank = rank % _CONTEXT_PARALLEL_SIZE |
| 60 | return cp_rank |
| 61 | |
| 62 | |
| 63 | def get_context_parallel_group_rank(): |
no outgoing calls
no test coverage detected