[V1][P/D] An native implementation of xPyD based on P2P NCCL (#18242)

Signed-off-by: Abatom <abzhonghua@gmail.com>
This commit is contained in:
Zhonghua Deng
2025-06-18 14:32:36 +08:00
committed by GitHub
parent 5f52a84685
commit eccdc8318c
8 changed files with 1780 additions and 0 deletions

View File

@@ -272,6 +272,14 @@ class NCCLLibrary:
ctypes.byref(unique_id)))
return unique_id
def unique_id_from_bytes(self, data: bytes) -> ncclUniqueId:
if len(data) != 128:
raise ValueError(
f"Expected 128 bytes for ncclUniqueId, got {len(data)} bytes")
unique_id = ncclUniqueId()
ctypes.memmove(ctypes.addressof(unique_id.internal), data, 128)
return unique_id
def ncclCommInitRank(self, world_size: int, unique_id: ncclUniqueId,
rank: int) -> ncclComm_t:
comm = ncclComm_t()