NVIDIA NCCL

Optimized primitives for collective multi-GPU and multi-node communication

Library
PyPI
v2.31.2
5,010stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
91/100Excellent
Development Activity100
Maintenance72
Community92
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
78/100Good
Architecture88
Code Quality85
Innovation85
Learning Curve55

NVIDIA NCCL (pronounced ‘Nickel’) implements multi-GPU and multi-node collective communication primitives — all-reduce, all-gather, reduce-scatter, broadcast, and reduce — optimized for NVIDIA GPU topologies including NVLink, PCIe, and InfiniBand. The nvidia-nccl-cu12 PyPI package ships prebuilt NCCL shared libraries so deep learning frameworks like PyTorch and TensorFlow can install it as a pip dependency without a manual CUDA toolkit build.

NCCL is the standard communication backend underlying distributed training in essentially every major deep learning framework, making cross-GPU gradient synchronization and model-parallel training performant at scale.

What You Get

  • Collective operations: all-reduce, all-gather, reduce-scatter, broadcast, and reduce across GPUs/nodes
  • Automatic topology detection (NVLink, PCIe, InfiniBand) to select optimal communication rings/trees
  • Point-to-point send/recv primitives for building custom communication patterns
  • CUDA graph compatibility for capturing communication into replayable execution graphs
  • Prebuilt PyPI wheels (nvidia-nccl-cu12) so frameworks can depend on NCCL without a manual CUDA build

Common Use Cases

  • Synchronizing gradients across GPUs during distributed deep learning training (data parallelism)
  • Implementing tensor/pipeline model parallelism for large language model training
  • Powering the communication backend of PyTorch’s torch.distributed, TensorFlow, and Horovod
  • Multi-node HPC workloads needing efficient GPU-to-GPU collective operations over InfiniBand

Under The Hood

Architecture - NCCL’s core (src/) implements topology detection (graph/), a device-side collective execution engine (device/), and a bootstrap/init layer (bootstrap.cc, init_nvtx.cc) that negotiates ring/tree communication topologies across GPUs and nodes at runtime, with a plugins/ mechanism for network transport backends (e.g. InfiniBand verbs). Tech Stack - Primarily C++ and CUDA (70%+ of the codebase) with CMake/Makefile build tooling, Python bindings (bindings/nccl4py) and an internal IR (bindings/ir) for higher-level integration, licensed under Apache-2.0 with some BSD-licensed borrowed components. Code Quality - As a foundational, security- and correctness-critical HPC library maintained directly by NVIDIA, it has an extensive internal test/validation process (documented via docs/ and CONTRIBUTING.md) though most testing infrastructure runs on NVIDIA’s internal multi-GPU hardware rather than public CI, typical of hardware-dependent systems libraries. API Design - The public C API (ncclAllReduce, ncclBroadcast, etc.) mirrors the shape of MPI collectives, giving it a low learning curve for anyone with HPC/MPI background, while framework integrations (PyTorch, TensorFlow) hide it almost entirely behind higher-level distributed APIs.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search