code: def print_all_ranks(tag, value, rank):
      world_size = torch.distributed.get_world_size()
      all_tensor = torch.zeros(world_size, dtype=torch.float32).to(
          get_accelerator().current_device_name()
      )
      all_tensor[rank] = value
      torch.distributed.all_reduce(
          all_tensor, op=torch.distributed.ReduceOp.SUM
      )
      print_rank_0(f"{tag} {all_tensor}", rank)
  
imports: import torch
  import torch.nn.functional
  import time
  import deepspeed
  from deepspeed.runtime.zero.partition_parameters import ZeroParamStatus
  from deepspeed.accelerator import get_accelerator
  from dschat.utils.utils import print_rank_0
label_desc: Use image node_id 1 for calling a global function with example usage: print_all_ranks(tag, value, rank) without return types