File size: 211 Bytes
07c6a04
 
 
 
 
 
 
1
2
3
4
5
6
7
8
import torch.distributed as dist


# Print debug information on selected rank
def print_rank(var_name, var_value, rank=0):
    if dist.get_rank() == rank:
        print(f"[Rank {rank}] {var_name}: {var_value}")