# NCCL NVIDIA の Collective Communication Library。LLM 分散訓練で最も広く使われる CCL で、ノード内は PCIe/NVLink、ノード間は RDMA を使って all-reduce / all-gather / reduce-scatter 等の集団通信と P2P(send/recv)を提供する。(Source: [[@2026__ASPLOS__Pulse - Fine-grained and Non-intrusive LLM Training Monitoring via Microsecond-level Traffic Measurement]], §2.1) [[Pulse]] にとっての要点: - 集団通信は **ring ベース / tree ベース**のアルゴリズムを count に応じて動的に選択するため、送信量はフックだけでは決まらない。Pulse はアクティブなピアのパターンから ring/tree を推定して期待送信量を導く(CollNet/NVLS は対象外)。 - 集団通信はデータを **slice**(≤1MB)に分割し、バブル緩和のため各集団通信を複数チャネル(≥2)に細分する(ノード間では 1 チャネル = 1 QP)。この slice 単位の同期がストラグラー由来のマイクロ秒のギャップを生む。 - **all-to-all** は NCCL 2.28 以前は専用オペレータを持たず P2P 操作の集合(カスタム集団通信)として実装され、MoE のトークンの dispatch/combine に使われる。Pulse は NCCL の Group call(`ncclGroupStart`/`End`)をフックして構成する P2P を束ねる。 他のソースでも LLM 訓練の標準通信基盤として頻出する([[MegaScale]]・[[Minder]]・LLM 訓練サーベイ)。 NCCL を基盤・対象とする周辺研究: - [[NCCLX]]([[@2025__arXiv__Collective Communication for 100k+ GPUs]])は NCCL を基盤に拡張した Meta の集合通信フレームワークで、ホスト駆動・カーネル駆動・コピーベースという NCCL の制約(動的引数の扱いにくさ、CUDA Graph 非互換、パディング)を比較対象として、ゼロコピーの [[CTran]] を提示する。(Source: [[@2025__arXiv__Collective Communication for 100k+ GPUs]], §2.2) - Mycroft([[@2025__SOSP__Mycroft - Tracing Dependencies in Collective Communication Towards Reliable LLM Training]])は NCCL(2.21.5)のソフトウェアスタックへ直接トレースポイントを追加する軽量計装(約1100行の C++)で、proxy スレッドから臨界経路のランタイム状態を連続トレーシングする。(Source: [[@2025__SOSP__Mycroft - Tracing Dependencies in Collective Communication Towards Reliable LLM Training]], §4.2) - [[eACGM]]([[@2025__IWQoS__eACGM - Non-instrumented Performance Tracing and Anomaly Detection towards Machine Learning Systems]])は `ncclAllReduce` 等の NCCL API を eBPF で計装してレイテンシとメッセージサイズを測定し、注入したネットワーク遅延・パケットロスを GMM で 85.04%(全層中最高)の精度で検知する。(Source: [[@2025__IWQoS__eACGM - Non-instrumented Performance Tracing and Anomaly Detection towards Machine Learning Systems]]) - [[XPUTimer]](Flare、[[@2025__arXiv__XPUTimer - Anomaly Diagnostics for Divergent LLM Training in GPU Clusters of Thousand-Plus Scale]])は `LD_PRELOAD` で NCCL カーネルをフックしつつ、通信ハング時には CUDA-GDB で稼働中の ring-allreduce カーネルのレジスタを読む intra-kernel inspecting で故障 GPU を O(1) 特定する。NCCL を debug 情報付きで再コンパイルする必要がない点が利点。(Source: [[@2025__arXiv__XPUTimer - Anomaly Diagnostics for Divergent LLM Training in GPU Clusters of Thousand-Plus Scale]]) - [[@2025__PMBS__Pretraining LLMs at Scale - Tuning Strategies and Performance Portability]] は、NCCL all-reduce ベンチマークを DeepSpeed 訓練前のチューニング段に使い、NCCL_NTHREADS や NCCL_MIN_NCHANNELS などの環境変数を探索する。64 GPU では改善は約 0.5% と小さいが、480 GPU 規模では BO チューニング済み構成が既定構成より GPU あたり最大 +10GB/s の帯域を得ると報告する。(Source: [[@2025__PMBS__Pretraining LLMs at Scale - Tuning Strategies and Performance Portability]]) **「Demystifying NCCL」([[@2025__IEEE__Demystifying NCCL - An In-depth Analysis of GPU Communication Protocols and Algorithms]])** は NCCL 2.19.1 の内部設計を初めて体系的に解析した論文。ETH Zürich SPCL・NVIDIA・Broadcom の共著。以下を文書化した: - **三プロトコル設計原理**: Simple(メモリフェンス・ほぼピーク帯域・~6µs/hop)・LL(フラグ同期・25〜50% 帯域・~1µs/hop)・LL128(フラグ同期・~95% 帯域・~2µs/hop、128B アトミック書き込みを要求し PCIe 環境では無効化)。 - **P2P_DIRECT モード**: 同一プロセス内では IPC ハンドルなし + directSend/directRecv で中間 FIFO バッファコピーを排除。 - **Ring AllReduce は 2k-1 ステップ**(ReduceScatter k-1 + AllGather k)、**Tree AllReduce は SM を非対称 2 分割**して Reduce/Broadcast を並行実行しパイプライン効率を高める。 - **LL128 はノード内(NVLink)で全メッセージサイズにわたり最も安定した性能**を示す。ノード間大メッセージでは Simple が一貫して最速。 - 本解析は ATLAHS シミュレーションツールチェーンの基盤となり誤差 5% 未満を達成。 ## 関連 - ソース: [[@2026__ASPLOS__Pulse - Fine-grained and Non-intrusive LLM Training Monitoring via Microsecond-level Traffic Measurement]] / [[@2025__arXiv__Collective Communication for 100k+ GPUs]] / [[@2025__SOSP__Mycroft - Tracing Dependencies in Collective Communication Towards Reliable LLM Training]] / [[@2025__IWQoS__eACGM - Non-instrumented Performance Tracing and Anomaly Detection towards Machine Learning Systems]] / [[@2025__arXiv__XPUTimer - Anomaly Diagnostics for Divergent LLM Training in GPU Clusters of Thousand-Plus Scale]] / [[@2025__PMBS__Pretraining LLMs at Scale - Tuning Strategies and Performance Portability]] / [[@2025__IEEE__Demystifying NCCL - An In-depth Analysis of GPU Communication Protocols and Algorithms]] - 概念: [[LLM分散学習]] / [[並列化戦略]] / [[Mixture-of-Experts]] / [[LLM学習モニタリング]] - エンティティ: [[Pulse]] / [[Megatron-LM]] / [[BlueField-3]] / [[NCCLX]] / [[eACGM]] / [[XPUTimer]] / [[ATLAHS]]