@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 61a3431613
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

[Bugfix][ROCm] Fixing trying to import non-existent symbols from libnccl.so (#25605)

Signed-off-by: Gregory Shtrasberg <Gregory.Shtrasberg@amd.com>

Gregory Shtrasberg committed Sep 29, 2025 at 17:01 UTC 61a34316136833f44ff0c8c3c44fb0f2254a4a2b
1 file changed +23 -4
vllm/distributed/device_communicators/pynccl_wrapper.py
+23 -4
@@ -30,7 +30,9 @@ from typing import Any, Optional
30 import torch
31 from torch.distributed import ReduceOp
32
33 +from vllm import envs
34 from vllm.logger import init_logger
35 +from vllm.platforms import current_platform
36 from vllm.utils import find_nccl_library
37
38 logger = init_logger(__name__)
@@ -275,10 +277,27 @@ class NCCLLibrary:
277 if so_file not in NCCLLibrary.path_to_dict_mapping:
278 _funcs: dict[str, Any] = {}
279 for func in NCCLLibrary.exported_functions:
278 - f = getattr(self.lib, func.name)
279 - f.restype = func.restype
280 - f.argtypes = func.argtypes
281 - _funcs[func.name] = f
280 + try:
281 + f = getattr(self.lib, func.name)
282 + f.restype = func.restype
283 + f.argtypes = func.argtypes
284 + _funcs[func.name] = f
285 + except AttributeError:
286 + if func.name in [
287 + "ncclCommWindowRegister",
288 + "ncclCommWindowDeregister"
289 + ]:
290 + if envs.VLLM_USE_NCCL_SYMM_MEM:
291 + logger.warning_once(
292 + "The symbol %s is not found in the NCCL "
293 + "library %s. To enable VLLM_USE_NCCL_SYMM_MEM "
294 + " please update your NCCL version to >= "
295 + "2.27.03.", func.name, so_file)
296 + if current_platform.is_rocm():
297 + # Having an exception here on ROCm platform is
298 + # not allowed during graph capturing
299 + continue
300 + raise
301 NCCLLibrary.path_to_dict_mapping[so_file] = _funcs
302 self._funcs = NCCLLibrary.path_to_dict_mapping[so_file]
303