Python bindings for the nccl-extensions communication libraries (nccl_ep, nccl_m2n)
Actively maintained. Last release 3 weeks ago, commits in 24 of the last 26 weeks. A safe choice.
pip install nccl-extensionsnccl-extensions (Python)
Python bindings for the nccl-extensions communication libraries.
Package layout
This package installs into the nccl namespace, so the import paths are
nccl.ep and nccl.m2n:
import nccl.ep as ep
import nccl.m2n as m2n
It contributes exactly three directories to that namespace, and no
nccl/__init__.py:
| path | contents |
|---|---|
nccl/ep/ | public facade for nccl_ep, plus CUDA-specific native libraries and headers |
nccl/m2n/ | public facade for NCCL M2N, plus CUDA-specific native libraries and headers. See the M2N Python guide for API usage and examples. |
nccl/_extensions/ | internals shared by every extension library — the Cython bindings, binding_dataclass, the distribution version |
Install
CUDA_HOME=/usr/local/cuda pip install -e python/
Building requires a CUDA toolkit and a Cython toolchain.
Stage native artifacts before building a distributable wheel:
python/nccl/ep/lib/cu{12,13}/libnccl_ep.so.0
python/nccl/ep/include/**
python/nccl/m2n/lib/cu{12,13}/libnccl_m2n.so
python/nccl/m2n/include/**
EP wheels include one regular SONAME file (currently libnccl_ep.so.0) in
each nccl/ep/lib/cu{12,13}/ directory. The Python loader opens this file
directly. Native consumers can link with -l:libnccl_ep.so.0 (or its full
path) and set RPATH/RUNPATH to the matching CUDA variant directory. Wheels
do not include the unversioned linker name or the full release-version name.
For a complete Linux wheel build, the internal
build_assets/build_wheels.sh script builds and
stages these artifacts in a temporary project copy before running
cibuildwheel. It does not stage artifacts into the source package tree.
Missing shared libraries emit explicit build warnings by default. Set to turn a missing library into a build error; the production wheel script sets this automatically. With the default value , the resulting wheel is not self-contained and needs compatible external libraries at runtime.