code: def _multi_node_mean_grad_async(self, model, zero_fill, stream):
      self._init_comms()
      params = _memory_utility.extract_params_set_grad(model, zero_fill)
  
      # NOTE: we need to explicitly check `is None` , because
      # numpy's dtype object is evaluated to False in numpy <= 1.12.1
      if self.allreduce_grad_dtype is not None:
          allreduce_grad_dtype = self.allreduce_grad_dtype
      else:
          allreduce_grad_dtype = chainer.get_dtype()
  
      assert allreduce_grad_dtype is not None
  
      n_elems = _memory_utility.count_grad_elements(params, zero_fill)
      needs_sync = self._prepare_allreduce_pack_buffer(
          allreduce_grad_dtype, n_elems
      )
      if stream != chainer.cuda.Stream.null and needs_sync:
          chainer.cuda.Stream.null.synchronize()
  
      # pack grads from params -> buffer A
      self._pack_params_to_buffer(
          params,
          "grad",
          self.gpu_buffer_a,
          allreduce_grad_dtype,
          zero_fill,
          stream,
      )
  
      # Allreduce from buffer A -> buffer B
      # div by comm_size from buffer B -> buffer A
      self._multi_node_mean_nccl(
          self.gpu_buffer_a,
          self.gpu_buffer_b,
          n_elems,
          allreduce_grad_dtype,
          stream,
      )
  
      # unpack params from buffer A -> params
      self._unpack_params_from_buffer(
          params,
          "grad",
          self.gpu_buffer_b,
          allreduce_grad_dtype,
          zero_fill,
          stream,
      )
  
file_path: chainer/chainermn/communicators/pure_nccl_communicator.py
imports: import warnings
  import chainer.cuda
  from chainermn.communicators import _communication_utility
  from chainermn.communicators import _memory_utility
  from chainermn.communicators import mpi_communicator_base
  from chainermn import nccl
  import numpy
label_desc: Use image node_id 8 for calling the PureNcclCommunicator obj's underlying member method code with example usage: obj._multi_node_mean_grad_async(model, zero_fill, stream) without return types