<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>MPI - 标签 - 集合通信博客</title><link>https://hccl.club/tags/mpi/</link><description>MPI - 标签 - 集合通信博客</description><generator>Hugo -- gohugo.io</generator><language>zh-CN</language><lastBuildDate>Sun, 15 Nov 2026 10:00:00 +0800</lastBuildDate><atom:link href="https://hccl.club/tags/mpi/" rel="self" type="application/rss+xml"/><item><title>Broadcast：广播</title><link>https://hccl.club/docs/primitives/broadcast/</link><pubDate>Mon, 02 Nov 2026 10:00:00 +0800</pubDate><author><name>Innoecho</name></author><guid>https://hccl.club/docs/primitives/broadcast/</guid><description>&lt;p>几乎每个分布式作业的第一步都是广播（Broadcast）：由 root 进程把同一份配置、超参数或控制消息，发送给通信域（Communicator）内的所有进程。它是语义最简单的一对多集合通信原语，也是理解 Scatter、AllGather、AllReduce 等更复杂原语的基石。&lt;/p></description></item><item><title>什么是集合通信</title><link>https://hccl.club/docs/basics/what-is-collective-communication/</link><pubDate>Sun, 01 Nov 2026 10:00:00 +0800</pubDate><author><name>Innoecho</name></author><guid>https://hccl.club/docs/basics/what-is-collective-communication/</guid><description>&lt;p>并行程序由多个进程（或线程、GPU）协同完成同一项任务：数据并行训练中各模型副本要交换梯度，流水线要分发批次，迭代求解器要同步收敛判据。这类「一组进程共同参与」的通信模式，就是集合通信（Collective Communication）。MPI、NCCL、Gloo 等通信库都把它作为一等公民来提供。&lt;/p>
&lt;p>本文回答三个问题：集合通信与点对点通信的本质区别是什么；常见集合操作如何分类、遵循什么调用规则；它是否等价于一次隐式的全局同步。读完之后，你将能准确描述一次 4 进程 AllReduce 的前后数据变化，并避开几个高频误解。&lt;/p></description></item><item><title>Scatter：散射</title><link>https://hccl.club/docs/primitives/scatter/</link><pubDate>Mon, 02 Nov 2026 10:20:00 +0800</pubDate><author><name>Innoecho</name></author><guid>https://hccl.club/docs/primitives/scatter/</guid><description><![CDATA[<p>如果说 Broadcast 解决的是&quot;人人都拿同一份&quot;，那么散射（Scatter）解决的就是&quot;人人各拿一份&quot;：root 进程把一段大缓冲区按进程号切成 $p$ 片，第 $i$ 片发给第 $i$ 个进程。它是数据并行训练中切分数据集、分布式矩阵计算中按行分发矩阵的基础原语。</p>]]></description></item><item><title>通信域、Rank 与进程组</title><link>https://hccl.club/docs/basics/communicator-and-rank/</link><pubDate>Sun, 01 Nov 2026 11:00:00 +0800</pubDate><author><name>Innoecho</name></author><guid>https://hccl.club/docs/basics/communicator-and-rank/</guid><description>&lt;p>「什么是集合通信」一文反复强调：集合操作的参与者是「一组进程」。那么这一组进程如何被精确定义？进程在组内如何编号？不同模块的消息如何避免串线？答案都指向同一个概念——通信域（Communicator）。它是 MPI 语义的核心构件，也被 NCCL 等 GPU 通信库以自己的方式实现。&lt;/p>
&lt;p>本文先讲清通信域的定义与 rank 编号规则，再分别给出 MPI、NCCL 和 PyTorch 中的实践代码，最后解释为什么 PyTorch 这类框架会同时维护一大堆通信域。&lt;/p></description></item><item><title>Gather：收集</title><link>https://hccl.club/docs/primitives/gather/</link><pubDate>Mon, 02 Nov 2026 10:40:00 +0800</pubDate><author><name>Innoecho</name></author><guid>https://hccl.club/docs/primitives/gather/</guid><description>&lt;p>收集（Gather）是散射（Scatter）的镜像操作：每个进程交出自己的一段数据，root 进程按进程号顺序把它们拼接成一段完整缓冲区。它是最典型的多对一原语，广泛用于把各工作进程的局部结果汇聚到主进程统一处理。&lt;/p></description></item><item><title>AllGather：全收集</title><link>https://hccl.club/docs/primitives/allgather/</link><pubDate>Mon, 02 Nov 2026 11:00:00 +0800</pubDate><author><name>Innoecho</name></author><guid>https://hccl.club/docs/primitives/allgather/</guid><description><![CDATA[<p>全收集（AllGather）是 Gather 的&quot;民主版&quot;：每个进程都把自己的块贡献出去，同时拿到所有进程的块，相当于人人都是 root 的 Gather。它是多对多通信的核心原语之一，大模型训练中的 ZeRO 参数聚合、张量并行的结果拼接都靠它完成。</p>]]></description></item><item><title>Reduce：规约</title><link>https://hccl.club/docs/primitives/reduce/</link><pubDate>Mon, 02 Nov 2026 11:20:00 +0800</pubDate><author><name>Innoecho</name></author><guid>https://hccl.club/docs/primitives/reduce/</guid><description><![CDATA[<p>规约（Reduce）是第一个&quot;边搬运边计算&quot;的集合原语：各进程的数据按指定算子（SUM、MAX、MIN、PROD 等）逐元素合并，最终结果只落在 root 进程上。它是多对一通信与计算的结合，也是梯度同步的核心组件 AllReduce 的直接基础。</p>]]></description></item><item><title>MPI 与主流实现：标准演进、协议与架构分叉</title><link>https://hccl.club/posts/comm-libs/mpi/</link><pubDate>Sun, 15 Nov 2026 10:00:00 +0800</pubDate><author><name>Innoecho</name></author><guid>https://hccl.club/posts/comm-libs/mpi/</guid><description><![CDATA[<p>MPI（Message Passing Interface，消息传递接口）是 HPC 世界最长寿的通信标准：MPI-4.0 于 2021 年 6 月发布、4.1 于 2023 年 11 月发布，如今仍在演进。它的核心抽象非常朴素：一组进程通过显式的消息传递来协作。与 NCCL 这种&quot;一个官方库&quot;的形态不同，MPI 是一个<strong>接口标准 + 多个竞争实现</strong>的生态：MPICH（及其衍生：Intel MPI、MVAPICH、AWS MPI 等）与 OpenMPI 两大阵营各有千秋——&ldquo;选哪个 MPI 实现&quot;本身就是一项工程决策。理解 MPI 的技术要点，需要同时理解&quot;标准规定了什么&quot;和&quot;实现各自把劲使在哪里&rdquo;。</p>]]></description></item></channel></rss>