code: def allgather_host(
      self,
      comm,
      cupy_server_sign_packed,
      cupy_recvbuf_sign_server,
      cupy_server_scale,
      cupy_recvbuf_scale_server,
  ):
      # 1. Convert cupy to numpy
      numpy_recvbuf_sign_server = np.zeros(
          [comm.Get_size(), cupy_server_sign_packed.size],
          dtype=cupy_server_sign_packed.dtype,
      )
      numpy_recvbuf_scale_server = np.zeros(
          [comm.Get_size(), 1], dtype=cupy_server_scale.dtype
      )
  
      numpy_server_sign_packed = cupy.asnumpy(cupy_server_sign_packed)
      numpy_recvbuf_sign_server = cupy.asnumpy(cupy_recvbuf_sign_server)
      numpy_server_scale = cupy.asnumpy(cupy_server_scale)
      numpy_recvbuf_scale_server = cupy.asnumpy(
          cupy_recvbuf_scale_server
      )
      cupy.cuda.get_current_stream().synchronize()
  
      # 2. Communicate numpy buffers
      comm.Allgather(
          numpy_server_sign_packed, numpy_recvbuf_sign_server
      )
      comm.Allgather(numpy_server_scale, numpy_recvbuf_scale_server)
      comm.Barrier()
  
      # 3. Convert numpy back to cupy
      cupy_server_sign_packed = cupy.asarray(numpy_server_sign_packed)
      cupy_recvbuf_sign_server = cupy.asarray(numpy_recvbuf_sign_server)
      cupy_server_scale = cupy.asarray(numpy_server_scale)
      cupy_recvbuf_scale_server = cupy.asarray(
          numpy_recvbuf_scale_server
      )
      cupy.cuda.get_current_stream().synchronize()
  
      return (
          cupy_server_sign_packed,
          cupy_recvbuf_sign_server,
          cupy_server_scale,
          cupy_recvbuf_scale_server,
      )
  
file_path: DeepSpeed/deepspeed/runtime/comm/mpi.py
imports: import torch
  import cupy
  import time
  import numpy
  from mpi4py import MPI
  from deepspeed.runtime.compression.cupy import CupyBackend
label_desc: Use image node_id 6 for calling the MpiBackend obj's underlying member method code with example usage: obj.allgather_host(comm, cupy_server_sign_packed, cupy_recvbuf_sign_server, cupy_server_scale, cupy_recvbuf_scale_server) and returns: cupy_server_sign_packed,  cupy_recvbuf_sign_server,  cupy_server_scale,  cupy_recvbuf_scale_server