code: def run(dev_id, args):
      dist_init_method = "tcp://{master_ip}:{master_port}".format(
          master_ip=args.master_ip, master_port=args.master_port
      )
      world_size = args.ngpu
      torch.distributed.init_process_group(
          backend="nccl",
          init_method=dist_init_method,
          world_size=world_size,
          rank=dev_id,
      )
      gpu_rank = torch.distributed.get_rank()
      assert gpu_rank == dev_id
      main(dev_id, args)
  
file_path: dgl/examples/pytorch/transformer/translation_train.py
imports: import argparse
  from functools import partial
  import numpy
  import torch
  import torch.distributed
  from dataset import *
  from loss import *
  from modules import *
  from modules.config import *
  from optims import *
label_desc: Use image node_id 2 for calling a global function with example usage: run(dev_id, args) without return types