code: def get_lst_from_rank0(lst: List[int]) -> None:
      """
      NOTE: creates both communication and synchronization overhead so should be used
      sparingly
      """
      lst_tensor = torch.tensor(
          lst if dist.get_rank() == 0 else [-1] * len(lst),
          dtype=int,
          # device=torch.cuda.current_device(),
          device=torch.device(
              "cuda:{}".format(os.environ["LOCAL_RANK"])
          ),
          requires_grad=False,
      )
      dist.broadcast(lst_tensor, src=0, async_op=False)
  
      return list(lst_tensor.cpu().numpy())
  
file_path: H2O/h2o_flexgen/benchmark/third_party/DeepSpeed/deepspeed/runtime/zero/utils.py
imports: import os
  from typing import List
  import torch
  from deepspeed import comm
  from deepspeed.utils import logger
  from deepspeed.ops.adam import DeepSpeedCPUAdam
  from deepspeed.ops.adam import FusedAdam
  from deepspeed.utils.nvtx import instrument_w_nvtx
label_desc: Use image node_id 3 for calling a global function with example usage: get_lst_from_rank0(lst) and returns: list