From 29fc66ae03f3ae5d16025c03d061d05e9161ad3d Mon Sep 17 00:00:00 2001 From: Amir Samani Date: Wed, 24 Sep 2025 13:55:56 -0700 Subject: [PATCH 1/2] put nccl window register/deregister behind cuda platform Signed-off-by: Amir Samani --- .../distributed/device_communicators/pynccl_wrapper.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/vllm/distributed/device_communicators/pynccl_wrapper.py b/vllm/distributed/device_communicators/pynccl_wrapper.py index c3e99e177e2d..2bd679d46887 100644 --- a/vllm/distributed/device_communicators/pynccl_wrapper.py +++ b/vllm/distributed/device_communicators/pynccl_wrapper.py @@ -31,6 +31,7 @@ from torch.distributed import ReduceOp from vllm.logger import init_logger +from vllm.platforms import current_platform from vllm.utils import find_nccl_library logger = init_logger(__name__) @@ -223,6 +224,9 @@ class NCCLLibrary: Function("ncclGroupStart", ncclResult_t, []), # ncclResult_t ncclGroupEnd(); Function("ncclGroupEnd", ncclResult_t, []), + ] + + exported_functions_cuda_specfic = [ # ncclResult_t ncclCommWindowRegister( # ncclComm_t comm, void* buff, size_t size, # ncclWindow_t* win, int winFlags); @@ -271,10 +275,12 @@ def __init__(self, so_file: Optional[str] = None): " to point to the correct nccl library path.", so_file, platform.platform()) raise e - + function_specs = list(NCCLLibrary.exported_functions) + if current_platform.is_cuda(): + function_specs.extend(NCCLLibrary.exported_functions_cuda_specfic) if so_file not in NCCLLibrary.path_to_dict_mapping: _funcs: dict[str, Any] = {} - for func in NCCLLibrary.exported_functions: + for func in function_specs: f = getattr(self.lib, func.name) f.restype = func.restype f.argtypes = func.argtypes From 5f7499cbab2168afec04ebcb566aa7b8e4806322 Mon Sep 17 00:00:00 2001 From: Amir Samani Date: Wed, 24 Sep 2025 14:03:20 -0700 Subject: [PATCH 2/2] typo Signed-off-by: Amir Samani --- vllm/distributed/device_communicators/pynccl_wrapper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vllm/distributed/device_communicators/pynccl_wrapper.py b/vllm/distributed/device_communicators/pynccl_wrapper.py index 2bd679d46887..b6ecc3392bd3 100644 --- a/vllm/distributed/device_communicators/pynccl_wrapper.py +++ b/vllm/distributed/device_communicators/pynccl_wrapper.py @@ -226,7 +226,7 @@ class NCCLLibrary: Function("ncclGroupEnd", ncclResult_t, []), ] - exported_functions_cuda_specfic = [ + exported_functions_cuda_specific = [ # ncclResult_t ncclCommWindowRegister( # ncclComm_t comm, void* buff, size_t size, # ncclWindow_t* win, int winFlags); @@ -277,7 +277,7 @@ def __init__(self, so_file: Optional[str] = None): raise e function_specs = list(NCCLLibrary.exported_functions) if current_platform.is_cuda(): - function_specs.extend(NCCLLibrary.exported_functions_cuda_specfic) + function_specs.extend(NCCLLibrary.exported_functions_cuda_specific) if so_file not in NCCLLibrary.path_to_dict_mapping: _funcs: dict[str, Any] = {} for func in function_specs: