def test_nccl_init(): n = nccl() uid = n.get_unique_id() n.init(1, uid, 0) assert 0 == n.user_rank() assert 0 == n.cu_device() n.destroy()
def _func_init_nccl(sessionId, uniqueId): """ Initialize ncclComm_t on worker :param workerId: int ID of the current worker running the function :param nWorkers: int Number of workers in the cluster :param uniqueId: array[byte] The NCCL unique Id generated from the client. """ wid = worker_state(sessionId)["wid"] nWorkers = worker_state(sessionId)["nworkers"] n = nccl() n.init(nWorkers, uniqueId, wid) worker_state(sessionId)["nccl"] = n