code: def _init_dist_pytorch(backend, **kwargs):
      # TODO: use local_rank instead of rank % num_gpus
      rank = int(os.environ["RANK"])
      num_gpus = torch.cuda.device_count()
      torch.cuda.set_device(rank % num_gpus)
      dist.init_process_group(backend=backend, **kwargs)
  
file_path: lavis/lavis/common/annotator/uniformer/mmcv/runner/dist_utils.py
imports: import functools
  import os
  import subprocess
  from collections import OrderedDict
  import torch
  import torch.multiprocessing
  from torch import distributed
  from torch._utils import _flatten_dense_tensors, _take_tensors, _unflatten_dense_tensors
label_desc: Use image node_id 2 for calling a global function with example usage: _init_dist_pytorch(backend) without return types