ColossalAI/applications/ChatGPT/chatgpt/trainer/utils.py

6 lines
121 B
Python
Raw Normal View History

2023-02-14 14:17:25 +00:00
import torch.distributed as dist
def is_rank_0() -> bool:
return not dist.is_initialized() or dist.get_rank() == 0