Return the (prev_rank, next_rank) global ranks of the immediate neighbours in group.
Ranks wrap around cyclically, so rank 0’s predecessor is the last rank in
the group.
- Parameters:
group (torch.distributed.ProcessGroup) – The process group to query.
- Returns:
(prev_rank, next_rank) as global ranks.
- Return type:
tuple[int, int]