Skip to content

vllm.utils.nccl

Functions:

_swap_env(values)

Set (None: unset) the given variables and return their previous values.

find_nccl_include_paths()

Return possible include paths containing nccl.h.

Considers VLLM_NCCL_INCLUDE_PATH and the nvidia-nccl-cuXX package.

find_nccl_library()

Return NCCL/RCCL shared library name to load.

Uses VLLM_NCCL_SO_PATH if set; otherwise chooses by torch backend.

find_nccl_library_paths()

Return possible library paths containing libnccl.so.

Looks inside the nvidia-nccl-cuXX pip package.

pin_nccl_env(pins)

Set NCCL variables for this process's own communicators.

NCCL never reconciles these across ranks, so communicators shared with a process that does not set them are created without them, see unpinned_nccl_env. NCCL caches most variables on first read; listing the pins in NCCL_NO_CACHE makes it re-read them per communicator. NCCL parses that list once, so this must run before the process's first NCCL call.

query_nccl_gin_type(group, *, railed=False)

Return the full or railed GIN type, or None on query failure.

unpinned_nccl_env()

Create communicators shared with other processes without the pins.