code: def get_global_group():
      """
      Singleton pytorch distributed group
      Inspired by https://github.com/pytorch/fairseq
      """
      if dist.is_initialized():
          if not hasattr(get_global_group, "_global_group"):
              # ideally we could use torch.distributed.group.WORLD, but it seems
              # to cause random NCCL hangs in some cases
              get_global_group._global_group = dist.new_group()
          return get_global_group._global_group
      else:
          return None
  
file_path: vissl/vissl/utils/fsdp_utils.py
imports: import torch.distributed
  import torch.nn
  from fairscale.nn import auto_wrap, default_auto_wrap_policy, enable_wrap
  from fairscale.nn.data_parallel import auto_wrap_bn, FullyShardedDataParallel
  from vissl.config.attr_dict import AttrDict
label_desc: Use image node_id 2 for calling a global function with example usage: get_global_group() and returns: get_global_group, None