utils.py 121 Bytes
Newer Older
BlueRum's avatar
BlueRum committed
1
2
3
4
5
import torch.distributed as dist


def is_rank_0() -> bool:
    return not dist.is_initialized() or dist.get_rank() == 0