def __init__(self, mpi_comm, batched_copy=False): super(NonCudaAwareCommunicator, self).__init__(mpi_comm) if not nccl._available: raise RuntimeError( 'NCCL is not available. ' 'Please confirm that NCCL is enabled in CuPy.' ) if nccl.get_version() < 2302: warnings.warn('NCCL 2.2 and older versions are deprecated.', DeprecationWarning) # We have to delay the initialization of communicators. This is because # NCCL's communicators use the current CUDA devices at the time of # initialization. Therefore, we have to initialize NCCL communicators # after users set the devices to use. self.inter_mpi_comm = None self.intra_nccl_comm = None self.gpu_buffer_a = _memory_utility.DeviceMemory() self.gpu_buffer_b = _memory_utility.DeviceMemory() self.cpu_buffer_a = _memory_utility.HostPinnedMemory() self.cpu_buffer_b = _memory_utility.HostPinnedMemory() self.batched_copy = batched_copy
def __init__(self, mpi_comm): super(NonCudaAwareCommunicator, self).__init__(mpi_comm) if not nccl._available: raise RuntimeError('NCCL is not available. ' 'Please confirm that NCCL is enabled in CuPy.') # We have to delay the initialization of communicators. This is because # NCCL's communicators use the current CUDA devices at the time of # initialization. Therefore, we have to initialize NCCL communicators # after users set the devices to use. self.inter_mpi_comm = None self.intra_nccl_comm = None self.gpu_buffer_a = _memory_utility.DeviceMemory() self.gpu_buffer_b = _memory_utility.DeviceMemory() self.cpu_buffer_a = _memory_utility.HostPinnedMemory() self.cpu_buffer_b = _memory_utility.HostPinnedMemory()
def __init__(self, mpi_comm): super(NonCudaAwareCommunicator, self).__init__(mpi_comm, use_nccl=True) self.gpu_buffer_a = _memory_utility.DeviceMemory() self.gpu_buffer_b = _memory_utility.DeviceMemory() self.cpu_buffer_a = _memory_utility.HostPinnedMemory() self.cpu_buffer_b = _memory_utility.HostPinnedMemory()