code: def __init__(self, ranks, rank_in_group):
      super(HaloExchangerSendRecv, self).__init__(ranks, rank_in_group)
      nccl_id = inc.get_unique_nccl_id(1).cuda()
      torch.distributed.broadcast(nccl_id, 0)
      nccl_id = nccl_id.cpu()
      print(
          "%d :: nccl_id = %s"
          % (torch.distributed.get_rank(), str(nccl_id))
      )
      # Create another global nccl communicator in addition to the one created by torch.distributed.init_process_group("nccl")
      # This is unavoidable because the underlying NCCL communicator torch.distributed creates is a protected variable, hence
      # it cannot be accessed from another class.
      # TODO: Figure out a way to avoid creating a second global communicator
      assert (
          torch.distributed.get_rank() == self.ranks[self.rank_in_group]
      ), "ranks[%d](%d) != torch.distributed.get_rank()(%d)" % (
          self.rank_in_group,
          self.ranks[self.rank_in_group],
          torch.distributed.get_rank(),
      )
      self.handle = inc.init_nccl_comm(
          nccl_id,
          torch.distributed.get_rank(),
          torch.distributed.get_world_size(),
      )
  
imports: import torch
  import torch.distributed
  from torch import nn
  import nccl_p2p_cuda
  import peer_memory_cuda
label_desc: Use image node_id 1 to create a new HaloExchangerSendRecv object from inherited base classes: HaloExchanger with example: obj = HaloExchangerSendRecv(ranks, rank_in_group)