# nccl-extensions **Repository Path**: ghsync/nccl-extensions ## Basic Information - **Project Name**: nccl-extensions - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-12-02 - **Last Updated**: 2026-12-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # NCCL Extensions NCCL Extensions is a repository of communication patterns for AI use cases, built on top of NCCL device and host APIs. It speeds up tensor communication for workloads like MoE token shuffle and reinforcement learning weight rollout. This is an evolving space, and the content here is under constant development and subject to change. We will continue exploring it and welcome your contributions. ## What's Inside ### [`nccl_ep/`](nccl_ep/) — Expert Parallelism Optimized dispatch and combine primitives for Mixture-of-Experts (MoE) token routing, built on NCCL's Device API (LSA and GIN operations). ### [`nccl_m2n/`](nccl_m2n/) — Mesh-to-Mesh Rollout Experimental library for resharding a tensor between two disjoint groups of GPU processes (e.g. trainer and inference ranks) in a single, zero-copy call, built on NCCL's window API. ### [`nccl_nd/`](nccl_nd/) — Tensor-Axis All-to-All Experimental all-to-all for Ulysses sequence/head redistribution, using CUDA pitched copies with NCCL memory windows and device-side barriers. ### [`python/`](python/) — Python bindings Python package (`nccl-extensions`) providing Pythonic wrappers for `nccl_ep` and `nccl_m2n` as `nccl.ep` and `nccl.m2n`. See [`python/README.md`](python/README.md) for details. ## Blogs and Papers - [NCCL EP powers dropless MoE training in JAX](https://developer.nvidia.com/blog/accelerating-dropless-moe-training-in-jax-with-nvidia-transformer-engine/) - [NCCL M2N: A Layout- and Topology-Aware Collective for Distributed Tensor Resharding](https://arxiv.org/abs/2610.07516) ## Installation Prebuilt Python wheels are available from [PyPI](https://pypi.org/project/nccl-extensions/) for Linux on x86-64 and aarch64, with CPython 3.10 through 3.14. Choose the extra matching your CUDA major version: ```bash # CUDA 12 python -m pip install "nccl-extensions[cu12]" # CUDA 13 python -m pip install "nccl-extensions[cu13]" ``` The CUDA extras are mutually exclusive. Each extra installs the corresponding CUDA runtime dependencies and **NCCL 2.32.3 or newer**, matching the vendored NCCL submodule. Older NCCL runtimes are rejected at startup. NCCL EP compiles kernels at runtime. Its CUDA toolkit, including `nvcc` and headers, must match the selected CUDA major version. Set `CUDA_HOME` when the toolkit is not discoverable automatically. Verify the installation: ```bash python - <<'PY' from importlib.metadata import version import nccl.ep import nccl.m2n print(version("nccl-extensions")) PY ``` See [`python/README.md`](python/README.md) for package layout, API usage, and editable installation details. ## Building from source This repo vendors NCCL as a git submodule. Clone with: ```bash git clone --recursive ``` (or initialize and build the vendored NCCL after a normal clone): ```bash make nccl-submodule ``` By default, NCCL keeps its native `third_party/nccl/build` output, while NCCL EP, NCCL M2N and NCCL ND place libraries under `build/lib` and headers under `build/include` at the repository root. Build all extensions or select one from the repository root. The targets place artifacts into the shared build tree: ```bash make # build all extensions make nccl_ep.build # build/{lib,include,...} make nccl_m2n.build # build/{lib,include,...} make nccl_nd.build # build/{lib,include,...} ``` Unless `NCCL_HOME` is set, plain `make` initializes and builds the vendored NCCL before building all extension libraries. `make clean` cleans all extensions without touching NCCL. Each library has an independent build-root override, while `BUILDDIR` changes the shared default for all extensions: `nccl_ep` currently requires NCCL >= 2.31 headers; building against older NCCL fails at compile time with a clear error. ```bash make nccl-submodule NCCL_BUILDDIR=/path/to/nccl/build make BUILDDIR=/path/to/extensions/build make nccl_ep.build NCCL_EP_BUILDDIR=/path/to/nccl-ep/build make nccl_m2n.build NCCL_M2N_BUILDDIR=/path/to/nccl-m2n/build make nccl_nd.build NCCL_ND_BUILDDIR=/path/to/nccl-nd/build ``` The root Makefile passes `NCCL_BUILDDIR` to NCCL as its native `BUILDDIR` variable. See each subproject's README for library-specific build options. ## Contributing We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) to get started. ## License This project is licensed under the Apache License, Version 2.0 — see [LICENSE.txt](LICENSE.txt) for details.