()
| 60 | |
| 61 | |
| 62 | def get_context_parallel_rank(): |
| 63 | assert _CONTEXT_PARALLEL_SIZE is not None, "context parallel size is not initialized" |
| 64 | |
| 65 | rank = torch.distributed.get_rank() |
| 66 | cp_rank = rank % _CONTEXT_PARALLEL_SIZE |
| 67 | return cp_rank |
| 68 | |
| 69 | |
| 70 | def get_context_parallel_group_rank(): |
no outgoing calls
no test coverage detected