<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>通信库 - 分类 - 集合通信博客</title><link>https://hccl.club/categories/%E9%80%9A%E4%BF%A1%E5%BA%93/</link><description>通信库 - 分类 - 集合通信博客</description><generator>Hugo -- gohugo.io</generator><language>zh-CN</language><lastBuildDate>Sun, 06 Dec 2026 10:00:00 +0800</lastBuildDate><atom:link href="https://hccl.club/categories/%E9%80%9A%E4%BF%A1%E5%BA%93/" rel="self" type="application/rss+xml"/><item><title>Grid、CTA 与 BarrierSession：CUDA 编程模型与 NCCL Device API 同步机制详解</title><link>https://hccl.club/posts/nccl-deviceapi-barriers/</link><pubDate>Sun, 06 Dec 2026 10:00:00 +0800</pubDate><author><name>Innoecho</name></author><guid>https://hccl.club/posts/nccl-deviceapi-barriers/</guid><description><![CDATA[<div class="barrier-post">

<p>NCCL 的 Device API 允许在 GPU kernel 里直接发起集合通信与同步，而读懂它的钥匙是把两套分层叠在一起：<strong>内核侧的线程分层</strong>（Thread → Warp → CTA → Grid）与<strong>通信侧的 rank 分层</strong>（LSA team → rail team → world team）。在两者的交点上，坐着一族 API——<strong>BarrierSession</strong>。本文用三章把这条线讲透：先讲 CUDA 编程模型的四层结构与硬件调度，再讲单机内同步与 NCCL 的 team 模型，最后逐参数拆解四种 BarrierSession 及用法。</p>]]></description></item><item><title>NCCL User Buffer Registration 深度解析：注册一次，集合通信全程零拷贝</title><link>https://hccl.club/posts/nccl-user-buffer-registration/</link><pubDate>Sun, 06 Dec 2026 10:00:00 +0800</pubDate><author><name>Innoecho</name></author><guid>https://hccl.club/posts/nccl-user-buffer-registration/</guid><description><![CDATA[<h1 id="nccl-user-buffer-registrationubr详解使用场景demo-与内部实现" class="headerLink">
    <a href="#nccl-user-buffer-registrationubr%e8%af%a6%e8%a7%a3%e4%bd%bf%e7%94%a8%e5%9c%ba%e6%99%afdemo-%e4%b8%8e%e5%86%85%e9%83%a8%e5%ae%9e%e7%8e%b0" class="header-mark"></a>NCCL User Buffer Registration（UBR）详解：使用场景、Demo 与内部实现</h1><blockquote>
  <p>本文基于 NCCL 2.32.7 源码（<code>src/register/</code> 重构版）。该版本中 UBR 子系统已相对 2.19
最初引入时的设计（<code>SENDRECV_BUF</code>/<code>READ_ONLY</code> 等标志）进行了重构，下文所有代码引用均以
该版本为准。</p>

</blockquote><h2 id="1-概述" class="headerLink">
    <a href="#1-%e6%a6%82%e8%bf%b0" class="header-mark"></a>1. 概述</h2><p><strong>User Buffer Registration（用户缓冲区注册）</strong> 是 NCCL 2.19 起提供的 API
（<code>ncclCommRegister</code> / <code>ncclCommDeregister</code>），允许应用把一段 CUDA 内存<strong>预先注册</strong>到
communicator，使后续集合操作可以直接对用户内存做零拷贝收发，而不再经过 NCCL 内部
FIFO 中转。</p>
<p>核心收益有两层：</p>
<ol>
<li><strong>消除每次调用的按需注册开销</strong>：RDMA/DMABUF 句柄导出、IPC 地址表交换、multicast
绑定等操作只在首次注册时做一次，之后每次集合调用直接命中缓存复用；</li>
<li><strong>消除数据中转拷贝</strong>：网络路径从&quot;用户 buffer → NCCL 内部已注册 FIFO → 对端 FIFO →
对端用户 buffer&quot;变成&quot;用户 buffer → 对端用户 buffer&quot;的直连 RDMA/P2P。</li>
</ol>]]></description></item><item><title>通信库系列</title><link>https://hccl.club/posts/comm-libs/</link><pubDate>Sun, 15 Nov 2026 18:00:00 +0800</pubDate><author><name>Innoecho</name></author><guid>https://hccl.club/posts/comm-libs/</guid><description>&lt;p>NCCL 的成功让「xCCL」成为一个家族的名字：凡是以 NCCL 为蓝本、面向特定硬件提供 AllReduce 等集合操作的库，都被社区冠以 xCCL 之称。NVIDIA 之外，华为、AMD、Intel、Meta 各自维护着自己的实现，与 NCCL 一起构成了今天分布式训练通信库的基本盘；再往下，UCX 与 libfabric 这类传输框架、MSCCL 这类可编程集合方案、ACCL 这类云厂商定制库，把生态从「加速器适配」延伸到「传输底座与算法可编程」。&lt;/p>
&lt;p>这些库解决的问题高度同构：给定一组进程与一块缓冲区，在特定互连上尽快完成归约或交换；差异在目标硬件、接口风格与框架集成度。本系列用 10 篇文章逐个拆解，本文先给出总览、接口趋同现象与选型建议。&lt;/p></description></item><item><title>NCCL：GPU 集合通信的事实标准</title><link>https://hccl.club/posts/comm-libs/nccl/</link><pubDate>Sun, 15 Nov 2026 17:00:00 +0800</pubDate><author><name>Innoecho</name></author><guid>https://hccl.club/posts/comm-libs/nccl/</guid><description>&lt;p>NCCL（NVIDIA Collective Communications Library）是 GPU 集群上事实标准的集合通信库，官方定位一句话：&lt;strong>topology-aware（拓扑感知）的 GPU 间通信原语&lt;/strong>。PyTorch DDP/FSDP、DeepSpeed、vLLM 等框架的梯度同步与张量并行通信，最终都落到 NCCL 上。与 MPI 这类功能全面的消息库不同，NCCL 只做一件事：在 NVIDIA 硬件上把集合通信跑到接近互连的理论上限。理解 NCCL 的关键技术点，就理解了 GPU 集群通信的设计方法。&lt;/p></description></item><item><title>RCCL：AMD ROCm 的集合通信库</title><link>https://hccl.club/posts/comm-libs/rccl/</link><pubDate>Sun, 15 Nov 2026 16:00:00 +0800</pubDate><author><name>Innoecho</name></author><guid>https://hccl.club/posts/comm-libs/rccl/</guid><description><![CDATA[<p>RCCL（ROCm Communication Collectives Library）是 AMD ROCm 软件栈中的集合通信库。它不是独立设计的新库，而是 NCCL 的衍生实现（fork）：源码基于 NCCL、API 沿用 <code>nccl*</code> 前缀（只是流类型换成 <code>hipStream_t</code>），仓库版权声明里至今保留 NVIDIA 的署名。要把 RCCL 的来龙去脉讲清楚，关键是理解**&ldquo;移植&quot;在集合通信库这件事上意味着什么**：算法和协议可以通用，但拓扑感知的那一层必须为 AMD 的互连体系重写。</p>]]></description></item><item><title>HCCL：昇腾 NPU 的集合通信库</title><link>https://hccl.club/posts/comm-libs/hccl/</link><pubDate>Sun, 15 Nov 2026 15:00:00 +0800</pubDate><author><name>Innoecho</name></author><guid>https://hccl.club/posts/comm-libs/hccl/</guid><description><![CDATA[<div style="border-left:4px solid #e8890c;background:#fff8ef;padding:10px 14px;border-radius:4px;margin:10px 0;">
  <strong>写作声明：</strong>HCCL（华为集合通信库）是<strong>闭源</strong>的，官方公开的实现细节很少。本文只采用官方文档、官方作者署名的论文，以及明确标注为「社区分析、未经官方确认」的资料；内部实现细节一律不作推测。
</div>
<p>HCCL 是华为昇腾（Ascend）NPU 生态的集合通信库，对应 CANN 软件栈，地位等同于 CUDA 生态里的 NCCL。它提供的原语集合与 NCCL 几乎一一对应：allreduce、allgather、broadcast、reduce_scatter、send/receive、reduce、alltoallv 等。理解 HCCL 的关键，不在&quot;C 语言 API 长什么样&quot;，而在<strong>它为之服务的硬件与 NCCL 完全不同</strong>——这是两个生态的分水岭。</p>]]></description></item><item><title>Gloo：传输无关的集合通信库</title><link>https://hccl.club/posts/comm-libs/gloo/</link><pubDate>Sun, 15 Nov 2026 14:00:00 +0800</pubDate><author><name>Innoecho</name></author><guid>https://hccl.club/posts/comm-libs/gloo/</guid><description><![CDATA[<p>Gloo 是 Meta（Facebook）开源的多机训练集合通信库，官方定位&quot;为多机训练提供各种集合原语&quot;。它与 NCCL 走的是<strong>相反的设计哲学</strong>：NCCL 为 NVIDIA GPU 拓扑深度定制，Gloo 则把&quot;数据怎么搬&quot;抽象成干净的接口，对传输介质与计算设备都保持中立。这个反差正是它的技术看点——<strong>用抽象换通用性</strong>。</p>]]></description></item><item><title>MSCCL/MSCCL++：编译驱动的可编程集合通信</title><link>https://hccl.club/posts/comm-libs/msccl/</link><pubDate>Sun, 15 Nov 2026 13:00:00 +0800</pubDate><author><name>Innoecho</name></author><guid>https://hccl.club/posts/comm-libs/msccl/</guid><description><![CDATA[<p>NCCL 的算法是<strong>预置</strong>的：数量有限的 CUDA kernel 覆盖选定拓扑与消息区间的组合，用户能做的只是用环境变量在它们之间切换。MSCCL（Microsoft Collective Communication Library）提出另一条路线：把集合通信算法<strong>编译成设备端可执行的程序</strong>——通信不再是从仓库里选一个 kernel，而是像写 CUDA 一样<strong>写出一个算法</strong>。这条路线在 2023-2025 年间把&quot;可编程集合通信&quot;从论文变成了 Azure 的生产组件，并进入了 RCCL 生态。</p>]]></description></item><item><title>oneCCL：Intel oneAPI 的集合通信库</title><link>https://hccl.club/posts/comm-libs/oneccl/</link><pubDate>Sun, 15 Nov 2026 12:00:00 +0800</pubDate><author><name>Innoecho</name></author><guid>https://hccl.club/posts/comm-libs/oneccl/</guid><description><![CDATA[<p>oneCCL（oneAPI Collective Communications Library）是 Intel oneAPI 的集合通信实现，如今由 UXL Foundation 治理。它的定位很微妙：<strong>既要服务 CPU 集群（传统 MPI 世界）又要服务 Intel GPU（Xe / Data Center GPU Max 系列）</strong>，所以它的关键技术点都围绕一个主题——<strong>异构</strong>：一种编程模型（SYCL）覆盖两种设备，两套传输后端（Intel MPI 与 libfabric）接入同一种网络，一套算法选择适配 CPU-only 与 GPU+CPU 两种集群形态。</p>]]></description></item><item><title>ACCL：阿里云灵骏的高性能集合通信库</title><link>https://hccl.club/posts/comm-libs/accl/</link><pubDate>Sun, 15 Nov 2026 11:00:00 +0800</pubDate><author><name>Innoecho</name></author><guid>https://hccl.club/posts/comm-libs/accl/</guid><description><![CDATA[<p>先说清一个容易踩的坑：<strong>业界有两个叫&quot;ACCL&quot;的东西，最出名的这个不是 AWS 的</strong>。阿里云 PAI 的 ACCL（Alibaba Collective Communication Library）是基于 NCCL 开发、闭源分发的高性能集合通信库；AWS 在 EFA 网络上做同类事情的组件叫 <code>aws-ofi-nccl</code>（NCCL 的 NET 插件）；还有一个 Xilinx 的 FPGA 集合库恰好也叫 ACCL——三者毫无血缘关系。本文的主角是阿里云灵骏智算集群上的 ACCL。</p>
<p>ACCL 的独特价值在于它的定位：<strong>&ldquo;结合阿里云网络特点和大模型通信调优经验&rdquo;</strong>。云厂商的网络（特定交换机拓扑、8 网卡服务器、RDMA 多队列）与 NCCL 预设的通用拓扑不同，ACCL 就是把这部分&quot;厂商才知道的优化&quot;沉淀成库的产物。</p>]]></description></item></channel></rss>