mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-05-17 04:40:54 +00:00
6 lines
121 B
Python
6 lines
121 B
Python
import torch.distributed as dist
|
|
|
|
|
|
def is_rank_0() -> bool:
|
|
return not dist.is_initialized() or dist.get_rank() == 0
|