code: def pg_worker(rank, world_size, init_file, func, *args):
      init_url = "file://" + init_file
      dist.init_process_group(
          backend=dist.Backend.NCCL,
          rank=rank,
          world_size=world_size,
          init_method=init_url,
      )
      torch.cuda.set_device(rank)
      dist.all_reduce(torch.zeros(1).cuda())
      func(*args)
      dist.destroy_process_group()
  
imports: import functools
  import tempfile
  import pytest
  import torch
  import torch.distributed
  import torch.multiprocessing
  from fairscale.fair_dev.testing.testing import make_cudnn_deterministic
  from fairscale.internal import torch_version
  from fairscale.nn import MOELayer, Top2Gate
label_desc: Use image node_id 1 for calling a global function with example usage: pg_worker(rank, world_size, init_file, func) without return types