Skip to content

分层 AllReduce / Pincer

此页面上的所有地址、符号和偏移量均适用于 libtpu-0.0.40-cp314 轮中的 libtpu.so(构建 ID 89edbbe81c5b328a958fe628a9f2207d,781,691,048 字节,未剥离,.text VA == 文件偏移量)。其他版本会有所不同;将每个 VA 视为版本固定。

摘要

SparseCore-offload AllReduce 配置构建器有一个 AllGather 和 ReduceScatter 构建器无法达到的分支:当 HierarchicalKind 参与且为真时,构建器将集合分解为 多相环列表,而不是单个扁平环。该页面拥有重新实现者无法从操作表面恢复的三个耦合事物:

  • 0x101层次分解。 ConstructConfigForCollectiveUniDirNDGroups<AllReduceOffloadConfig, …>(0x133c2dc0)重新加载16位HierarchicalKind,计算is_hierarchical = (kind & 0x101) != 0x100(反编译第806行:v637 = (v63 & 0x101) != 256),并在真正的臂将芯片内 D2D 相环 + 每个环面轴一个芯片间环发送到 PerColorIciStrategyConfig.phase_rings 列表中 - 与平臂的单个显式邻居环相比。 AllGather (0x133c82c0) 和ReduceScatter (0x133cd800) 将标志硬连接到0x100,因此只有AllReduce 采用此路径
  • IciStrategyRingConfig 叶子布局。 每环原型叶子 — 其 13 个标量字段固定到字节偏移量 0x18..0x53,带有 hasbits 0x1..0x1000 和原型字段编号 — 包括此构建器 写入 的字段 (partner_transfers_outside_the_ring @0x3e、core_count_adjustment @0x40)以及为以后的运行时传递留下的三个(barrier_id @0x30、id_info_offset @0x50、group_info_table_offset @0x4c)。
  • AllReduce 钳式融合。 双向环系列 (RotatedPincer* / AsyncPincer*),其减少分散臂和全聚集臂是可分离的 — 与自完成 二项式蝶形 的结构相反 — 并且保持 2-D [dim][color]来自 保留 AllReduce sflag 槽 (GetAllReduceSyncFlagNumber(1)/(2)) 的 sflag 表,而不是二项式表。

单轴二项式/递归加倍发射极环路和环偏移消费者记录在别处(二项式/递归加倍ICI AllReduce 原语);本页重点介绍分层分解+环配置场图+钳融合臂

AllReduce 构建器(模板化主体)ConstructConfigForCollectiveUniDirNDGroups<AllReduceOffloadConfig, HloAllReduceInstruction>0x133c2dc0(3826 反编译行)
AllReduce ND 包装ConstructConfigForAllReduceUniDirND0x133c2c80
每颜色phase_rings附加器$_ lambda(long color) — 0x133ddae0(返回附加环;呼叫者填写字段)
分层使能门ShouldEnableSparseCoreHierarchicalAllReduce0x1d6b6d80
每轴环调光/范围生产者GetDimensionRings0x133df520(跳转表 0xae2eaac)
环配置叶原型IciStrategyRingConfig_InternalSerialize 0x1d6ec320ByteSizeLong 0x1d6ec700MergeImpl 0x1d6ec120Clear 0x1d6ec2c0
钳融合臂RotatedPincerFusionEmitter::EmitAllReduceScatterFusion (0x1376c4e0) / EmitAllGatherFusion (0x13771640); AsyncPincerFusionEmitter::EmitAllReduceScatterFusion (0x13776fc0);匿名-ns EmitAllGatherFusion $_1 lambda thunk (0x1374e580); TpuAllReduceScatterFusion通行证
Pincer 标志初始化AsyncPincerInstance::InitSflags 0x13782fc0; RotatedPincerEmitterBase::InitSyncFlags 0x137a56a0
保留 AllReduce 标志Target::GetAllReduceSyncFlagNumber0x1d60f440(插槽 +2/+3)
来源 TUplatforms/xla/sparse_core/offload_collective_config.cc(构建器 + GetDimensionRings)

扁平与分层调度 (0x101)

三个SparseCore-offload集合构建器是相同的模板ConstructConfigForCollectiveUniDirNDGroups<OffloadConfig, HloInst>,实例化了三次。 ND 包装器的不同之处在于一件事:它们推送的 HierarchicalKind 参数的值。

集体建造者本体HierarchicalKind 源码能达到分层吗?
AllReduce0x133c2dc0包装器 0x133c2c80 推送由 ShouldEnableSparseCoreHierarchicalAllReduce (0x1d6b6d80) 门控的真实 optional<int>
AllGather0x133c82c0包装器 0x133c76c0 引脚 r9d = 0x100无(始终平坦)
ReduceScatter0x133cd800包装器 0x133ccbe0 引脚 r9d = 0x100无(始终平坦)

HierarchicalKind 是 16 位 AutoOr<bool>:位 0x100参与判别式,位 0x1 是布尔值。调度会屏蔽位并针对engage-but-false 编码进行测试:

c
// ConstructConfigForCollectiveUniDirNDGroups<AllReduceOffloadConfig,...> — 0x133c2dc0
// decompile line 806 (the is_hierarchical byte)
v637 = (v63 & 0x101) != 256;   // 256 == 0x100
//        ^ mask {engaged, value}     ^ 0x100 == engaged + value-false
// is_hierarchical = (kind & 0x101) != 0x100
//   0x100 (engaged, false) -> FLAT     ; v637 = 0
//   0x101 (engaged, true)  -> HIER     ; v637 = 1
```text

后来,`if (v637) goto hier; else goto flat;`选择了片间环形形状。相同的谓词逐字节出现在 AllGather 主体中,作为针对堆栈槽的直接 `cmp $0x100` — 但 AG/RS 永远无法满足它,因为它们的包装器将类型固定为 `0x100`。

> **注意 —** 位 `0x100` / 位 `0x1` `AutoOr<bool>` 编码与卸载配置管道中使用的相同的参与判别模式相同;请参阅 [分层种类](hierarchical-kind.md) 了解承载它的 `*OffloadConfig` 结构布局。

---

## 多相分解

每个 `PerColorIciStrategyConfig.phase_rings` 都是 `IciStrategyRingConfig` 叶子的 **有序列表** - 原始字段名称 `phase_rings` 本身就证实了这是一个多相结构,而不是单个环。构建器通过按颜色附加器 lambda (`0x133ddae0`) 按相顺序附加环,其中 `Add` 将新的 `IciStrategyRingConfig` 附加到右侧 `PerColorIciStrategyConfig` 并返回指针; **然后呼叫者填写环的字段**

```text
PerColorIciStrategyConfig (one per color)
  phase_rings:  [ Phase 0: D2D intra-chip ]   <- emitted first, megacore-gated
                [ Phase 1: torus axis 0   ]   \
                [ Phase 2: torus axis 1   ]    >  one ring PER axis (hierarchical)
                [ ...                     ]   /   OR one collapsed ring (flat)

Phase 0 — D2D 芯片内环(双臂,兆核门控)

当芯片承载多个逻辑核心(兆核心/跨核心字节,test $0x1,%bl)时,构建器会为每种颜色添加一个设备到设备环。它的字段在扁平臂和分层臂上都是相同的——芯片内相位是共享的;仅芯片间相位不同。

c
// D2D phase emission — 0x133c2dc0, decompile lines 3263-3265
*(_DWORD *)(v103 + 36) = 2;    // ring_neighbor   = ICI_RING_NEIGHBOR_IMPLICIT (2)  @0x24
*(_DWORD *)(v103 + 56) = 7;    // ring_dim        = ICI_RING_DIM_D2D          (7)  @0x38
*(_BYTE  *)(v103 + 60) = 1;    // across_cores_on_chip = true                       @0x3c
// hasbits |= 0x64  (ring_neighbor | ring_dim | across_cores)
```text

### 阶段 1..N — 芯片间环

每轴外循环遍历 ND 平面轴的双端队列(`170 * (… >> 3)` / `/ 0xAA` 块迭代器在 `0xaa` 字节元组块上)。每个元组生成 `(ringDim, lo, hi)`;构建器计算环长度(`idiv` 按设备计数,乘以兆核时每芯片逻辑设备数),然后采用平面或分层块。

**FLAT块**(一个折叠的EXPLICIT邻居环,在`is_hierarchical == 0`时拍摄):

```c
// FLAT inter-chip ring — 0x133c2dc0, decompile lines 3548-3559 + 3564
*(_QWORD *)(v114 + 24) = v119;          // core_count = computed ring length   @0x18
*(_DWORD *)(v114 + 36) = 1;             // ring_neighbor = ICI_RING_NEIGHBOR_EXPLICIT (1) @0x24
// --- flat_map<IciStrategyRingDim, RingConfigAttributes>::operator[](ringDim) (0x133ddc60) ---
*(_QWORD *)(v114 + 40) = *(_QWORD *)v108;       // ring_neighbor_table_offset = RCA[+0]  @0x28
*(_BYTE  *)(v114 + 61) = *(_BYTE *)(v108 + 8);  // has_reordering_map         = RCA[+8]  @0x3d
*(_DWORD *)(v114 + 72) = v107;          // explicit_strategy_ring_dim = ringDim          @0x48
*(_BYTE  *)(v114 + 62) = 0;             // partner_transfers_outside_the_ring = false    @0x3e
// hasbits |= core_count | ring_neighbor | table_offset | has_reordering | explicit_dim | partner

HIER 块(每轴一个隐式相邻环,在 is_hierarchical == 1 时采用):

c
// HIERARCHICAL inter-chip ring — 0x133c2dc0, decompile lines 3531-3537 + 3564 + 3621
*(_DWORD *)(v114 + 36) = 2;             // ring_neighbor = ICI_RING_NEIGHBOR_IMPLICIT (2)  @0x24
*(_DWORD *)(v114 + 56) = v118;          // ring_dim = the per-axis ringDim (X/Y/Z torus|mesh) @0x38
if (across_cores_first_axis)            //   only on axis 0 when megacore
    *(_BYTE *)(v114 + 60) = 1;          // across_cores_on_chip = true                    @0x3c
*(_BYTE  *)(v114 + 62) = 0;             // partner_transfers_outside_the_ring = false     @0x3e
if (logical_devices_per_chip >= 2 && adjustment > 0)// megacore adjust (v141 branch)
    *(_QWORD *)(v143 + 64) = adjustment;// core_count_adjustment = v105 (= len*lpc)       @0x40
// hasbits |= ring_neighbor | ring_dim [| across_cores] [| core_count_adjustment 0x200]
```text

决定性的分歧:平臂直接**设置 `core_count`(环长)并携带预先计算的 `ring_neighbor_table_offset`(由 `IciStrategyRingDim` 键入的平面地图查找);分层臂设置****明确的长度和****邻居表 - 它每个轴携带`ring_dim`,并让消费者从`ring_dim`加上超级核心`core_count_adjustment`得出长度。分层分解是 TensorCore 减少分散/全聚集相位分割的 SparseCore 模拟:每个“环面维度”一个相位,而不是单个折叠环。

| 方面 | 平 (`kind & 0x101 == 0x100`) | 分层 (`kind & 0x101 == 0x101`) |
|---|---|---|
| `phase_rings` 每个颜色 | `[D2D?] +` **一个**显式环 | `[D2D?] +` **每个环面轴一个环** |
| 片间邻居 | `ICI_RING_NEIGHBOR_EXPLICIT` (1) | `ICI_RING_NEIGHBOR_IMPLICIT` (2) |
| 环长携带 | `core_count`(`0x18`)直接设置 | 隐式; `core_count_adjustment` (`0x40`) megacore delta |
| 邻居表 | `ring_neighbor_table_offset` (`0x28`) + `has_reordering_map` (`0x3d`) | 无(隐式排序) |
| 环形暗场 | `explicit_strategy_ring_dim` (`0x48`) | `ring_dim` (`0x38`) 每轴 |
| D2D片内环 | 发射如果兆核(阶段 0) | 发射如果兆核(阶段 0) |
| 达到 | AG/RS(固定)+ AR(标记关闭) |AllReduce(标记已启用 + true) |

> **注意 —** 每轴 `ringDim` 是 `2 - (NDPlaneInfo[+0xa0] & 1)`,即每个低奇偶校验位的 `ICI_RING_DIM_X_TORUS` (1) 或 `ICI_RING_DIM_X_MESH` (2)(以及通过双端队列元组的 Y/Z 类似物)。相反,平臂通过 `GetDimensionRings` (`0x133df520`) 进行路由,其位于 `0xae2eaac` 的 7 项跳转表将每个 `IciStrategyRingDim` 映射到芯片环面范围(`X=0x58`、`Y=0x5c`、`Z=0x60`)和环面与网格标志,然后将范围除以设备计数(兆核感知)以填充 `RingConfigAttributes`。 `[+0xa0]` 奇偶校验位编码的物理属性未固定(低) - 请参阅 [张量分裂ND平面](tensor-split-ndplane.md)。

---

## `IciStrategyRingConfig` 实地地图

每个环叶是一个标准的 proto2 消息:`+0x00` 处的 vptr、`+0x08` 处的 `InternalMetadata`、`+0x10` 处的 hasbits `int32`,然后是标量打包的 `0x18..0x53`。每个 `{offset, width, hasbit, number}` 三元组**在三种独立生成的方法中达成一致** — `_InternalSerialize` (`0x1d6ec320`)、`ByteSizeLong` (`0x1d6ec700`) 和 `MergeImpl` (`0x1d6ec120`) — 并且名称/编号来自序列化`FieldDescriptorProto`。

| # | 字段 | 原型 | 偏移 | 宽度 | 哈比特 | 电线标签 |
|---|---|---|---|---|---|---|
| 1 | `ring_type` | 枚举 | `0x20` | 4 | `0x0002` | `0x08` |
| 2 | `core_count` | int64 | `0x18` | 8 | `0x0001` | `0x10` |
| 3 | `ring_neighbor` | 枚举 | `0x24` | 4 | `0x0004` | `0x18` |
| 4 | `ring_dim` | 枚举 | `0x38` | 4 | `0x0020` | `0x20` |
| 5 | `ring_neighbor_table_offset` | int64 | `0x28` | 8 | `0x0008` | `0x28` |
| 6 | `barrier_id` | int64 | `0x30` | 8 | `0x0010` | `0x30` |
| 7 | `across_cores_on_chip` | 布尔值 | `0x3c` | 1 | `0x0040` | `0x38` |
| 8 | `has_reordering_map` | 布尔值 | `0x3d` | 1 | `0x0080` | `0x40` |
| 9 | `explicit_strategy_ring_dim` | 枚举 | `0x48` | 4 | `0x0400` | `0x48` |
| 10 | `core_count_adjustment` | int64 | `0x40` | 8 | `0x0200` | `0x50` |
| 11 | `partner_transfers_outside_the_ring` | 布尔值 | `0x3e` | 1 | `0x0100` | `0x58` |
| 12 | `id_info_offset` | int64 | `0x50` | 8 | `0x1000` | `0x60` |
| 13 | `group_info_table_offset` | int32 | `0x4c` | 4 | `0x0800` | `0x68` |

串行器准确读取这些字偏移量 - 例如`WriteInt64ToArrayWithField<2>(… *((_QWORD*)this + 3) …)` 读取字节 `0x18` (`core_count`)、`<5>` 读取 `+5`=`0x28` (`ring_neighbor_table_offset`)、`<6>` 读取`+6`=`0x30`(`barrier_id`),`<10>` 读取 `+8`=`0x40`(`core_count_adjustment`),`<12>` 读取`+10`=`0x50`(`id_info_offset`),`WriteInt32<13>`读取为`+19`=`0x4c`(`group_info_table_offset`);三个 bool 字节在 `60`/`61`/`62` (`0x3c`/`0x3d`/`0x3e`) 处读取。 `Clear` (`0x1d6ec2c0`) 使用 `vmovups %ymm0, 0x18` (`0x18..0x37`) + `movq $0, 0x36` 将块归零,然后使用 `vmovups %xmm0, 0x48` + `vmovups %xmm0, 0x3e`,并重置 hasbits — 与打包布局紧密匹配。

### 三个环枚举(值编号,来自 `EnumDescriptorProto` 的字节精确)

| `IciStrategyRingType` | # |  | `IciStrategyRingNeighbor` | # |  | `IciStrategyRingDim` | # |
|---|---|---|---|---|---|---|---|
| `INVALID_RING_TYPE` | 0 |  | `NEIGHBOR_INVALID` | 0 |  | `RING_DIM_INVALID` | 0 |
| `BIDIR` | 1 |  | `NEIGHBOR_EXPLICIT` | 1 |  | `X_TORUS` | 1 |
| `UNIDIR_CW` | 2 |  | `NEIGHBOR_IMPLICIT` | 2 |  | `X_MESH` | 2 |
| `UNIDIR_CCW` | 3 |  |  |  |  | `Y_TORUS` | 3 |
| `UNIDIR_ALL_TO_ALL_CW` | 4 |  |  |  |  | `Y_MESH` | 4 |
| `UNIDIR_ALL_TO_ALL_CCW` | 5 |  |  |  |  | `Z_TORUS` | 5 |
|  |  |  |  |  |  | `Z_MESH` | 6 |
| | | | | | | `D2D` | 7 |

因此,发射常数准确解码:平面 `ring_neighbor = 1 = EXPLICIT`、分层/D2D `ring_neighbor = 2 = IMPLICIT`、D2D `ring_dim = 7`、每轴 `ring_dim ∈ {1 X_TORUS, 2 X_MESH}`。

> **注意 —** 标准每轴/D2D 发射 ****写入 `ring_type`(字段 1,`0x20`) — 它保留在附加程序 lambda 的标记/原型默认值中。显式 `UNIDIR_CW` (2) / `UNIDIR_CCW` (3) 常量仅写入单独的张量分割/可步进发射区域(`*(_DWORD*)(… + 56) = 2*v490 + 1` 环型标记和 `movl $0x2/$0x1, 0x20` 写入),该区域提供不同的生成选项。下游通道是否重写每个轴的 `ring_type` - 以及每个相如何选择 CW 与 CCW - 此处未追踪(低)。
>
> **注意 —** 三个已确认的字段**不是**由此处解码的构建器编写的:`barrier_id` (`0x30`)、`id_info_offset` (`0x50`) 和 `group_info_table_offset` (`0x4c`)。它们的偏移量和 hasbits 在所有三个 proto 方法中都是字节确认的,但填充器是一个单独的运行时屏障/id 分配传递,它消耗 proto。它们的设置位置尚未确定(低)。同样,`RingConfigAttributes` POD:扁平路径仅读取 `+0x0` (`ring_neighbor_table_offset`) 和 `+0x8` (`has_reordering_map`); `0x10..0x17` 槽由平面映射机器复制,但未被 AllReduce 平面发射读取(低 — 通过 AG/RS 平面 `core_count` 填充进行解码)。

---

## AllReduce钳形融合

钳子是与上面的分层配置构建器不同的发射器系列,并且与 [二项式蝶形](binomial-recursive-doubling.md) 不同。它是**双向环** AllReduce,其显着特征(对于选择在何处融合周围计算的重新实现者)是它的 **reduce-scatter 臂和 all-gather 臂是可分离的**。二项式蝶形是自完成的(每一步都发送和减少,没有可分离的分散或聚集阶段);相反,钳子将两半暴露为不同的可熔臂,这使得周围的 matmul 瓷砖可以“进入”集体(windowed-einsum)。

### 两个融合臂

`MayFuseAllReduce`(`0x127acfc0`)决定`HloAllReduceInstruction`是否熔成钳形; `TpuAllReduceScatterFusion` HLO pass(`GetFusionSpec` `0x127a8d60`、`MaybeGetAllReduceScatterLayout` `0x127a8b60`)处理减少散射侧。在下降时,手臂由 `EmitAllReduceScatterFusion` 和 `EmitAllGatherFusion`(`0x1374e580` 处的 `EmitAllGatherFusion` thunk 接受 `Span<ShardingConfig>`、`InfoTable` 和 `std::function` 提供者)通过 `AsyncPincerFusionEmitter` / 发出`RotatedPincerEmitter` 层次结构。

|  | 二项式蝶形 | 钳融合 |
|---|---|---|
| 发射器 | `BinomialSinglePhaseRingSumEmitter` (`0x13769be0`) | `RotatedPincerEmitter` / `AsyncPincerFusionEmitter` |
| 减缩臂/广播臂 | 融合为一次遍历(不可分离) | **可分离** — RS 臂和 AG 臂暴露用于开窗 |
| 融合臂发射器 || `EmitAllReduceScatterFusion` (`0x1376c4e0`/`0x13776fc0`) / `EmitAllGatherFusion` (`0x13771640`; anon-ns thunk `0x1374e580`) |
| 时间表来源 | 二项式副本表(ConstantMapper类型7) | `net_util::GetRingLocation`(无预计算表) |
| 标志 | 7 通用接收标志 | **保留** AllReduce 插槽 (`GetAllReduceSyncFlagNumber`) |
| 方向/步骤 | 一只(蝴蝶伙伴) | 二(顺时针旋转+逆时针反向旋转) |
| 适合时 | 小型 2 次幂环,延迟受限 | 大环、带宽限制、窗口 einsum 重叠 |

### 钳形旗台——双向确凿证据

钳子在**每步两个方向**运行带宽最佳环旋转 - 每个方向覆盖半个环,`⌈N/2⌉` 步 - 因此它为旋转和反向旋转的分片保留**单独的同步标志**。 `RotatedPincerEmitterBase::InitSyncFlags` (`0x137a56a0`) 从两个*保留的* AllReduce 槽中提取这些标志,并遍历嵌套的 `[dim][color]` 循环:

```c
// RotatedPincerEmitterBase::InitSyncFlags — 0x137a56a0, decompile lines 155/176/196
AllReduceSyncFlagNumber = Target::GetAllReduceSyncFlagNumber(v25, 1);   // direction-1 slot (base+count+2)
v29                     = Target::GetAllReduceSyncFlagNumber(v28, 2);   // direction-2 slot (base+count+3)
while (1) { ... }   // per (dim, color): install one flag pair

GetAllReduceSyncFlagNumber (0x1d60f440) 的完整 .text 交叉引用显示每个调用者都在钳子家族中 - AsyncPincerInstance::InitSflags(两个重载,0x13782fc0 / 0x137835e0), RotatedPincerEmitterBase::InitSyncFlags (0x137a56a0) 和 RotatedPincerShortEmitter::Init (0x137ba900) — 二项式发射器中没有**,分层配置生成器中没有。这是三拓扑分割:

  • 二项式蝶形CreateStaticBinomialReplicaInfoTable 预先计算的 int32[N×8] 合作伙伴时间表,7 个通用接收标志 (二项式/递归加倍)。
  • 环旋转net_util::GetRingLocation{ring_index, position, ring_size},无预先计算表。
  • Pincer 双向net_util::GetRingLocation 加上 保留的 sflag 插槽 (GetAllReduceSyncFlagNumber(1)/(2)) 和 2-D [dim][color] 标志表。

注意 — 拾取器在二项式/环式/钳式之间的选择是正确性和性能叉,而不是质量旋钮。二项式对于 2 的幂 N ≤ 128 合法;选择钳子用于大带宽限制环和窗口 einsum 重叠。将生产者融合为“二项式归约分散臂”的重新实现者误读了拓扑——蝴蝶中不存在该臂;它仅存在于钳融合中。共享两个 TensorCore 核心的每个钳臂的超级核心拆分位于 巨核融合 中。


重新实施清单

  • **调度:**重新加载16位HierarchicalKindis_hierarchical = (kind & 0x101) != 0x100。将标志固定到 0x100 以用于 AllGather 和 ReduceScatter — 只有 AllReduce 可以采用分层臂。
  • 阶段列表:phase_rings 构建为每种颜色的有序列表。仅当芯片为兆核时,才在前面添加 D2D 环(ring_neighbor=IMPLICITring_dim=D2D(7)across_cores_on_chip=true)。
  • 平片间环: 一环 — core_count = 计算长度,ring_neighbor=EXPLICIT(1)ring_neighbor_table_offset + has_reordering_map,来自 RingConfigAttributes[ringDim]explicit_strategy_ring_dim=ringDimpartner_transfers=false
  • **分层芯片间环:每个环面轴一个环ring_neighbor=IMPLICIT(2)ring_dim=ringDim(X/Y/Z 环面|网格)、across_cores_on_chip 仅在兆核时的第一个轴上,设置 core_count_adjustment(计算的兆核增量) logical_devices_per_chip ≥ 2。没有core_count,没有邻居表。
  • 叶布局:IciStrategyRingConfig 与字段映射表中的字节偏移处的 13 个字段一起放置;将三个布尔值打包在 0x3c/0x3d/0x3e,将枚举打包在 0x20/0x24/0x38/0x48/0x4c,将 int64 打包在 0x18/0x28/0x30/0x40/0x50;在 0x10 处有 int32。
  • Pincer: 对于双向融合,从 GetAllReduceSyncFlagNumber(1)/(2) 中绘制两个方向标志并键入 [dim][color] 标志表;保持减少分散臂和全聚集臂可分离,以实现窗口 einsum 重叠。 不要将钳子穿过二项式复制表。

交叉引用

  • 集体概述 — 系列分类法和策略选择器,选择扁平与分层、二项式与环式与钳式。
  • 二项式/递归加倍 — 单轴蝶形发射极环路(本页的自完成拓扑与钳形对比)。
  • SelectND策略 - 选择环形和降级轴处理的每轴拾取器。
  • 分层种类 — 携带 0x100/0x101 AutoOr<bool> 标志的 AllGather/AllReduce/ReduceScatter OffloadConfig 结构。
  • 巨核融合 — 缩减臂/广播臂如何在两个 TensorCore 核心之间融合。
  • 张量分裂ND平面 — 选择每轴 X_TORUSX_MESHNDPlaneInfo 奇偶校验字。
  • ICI 全归约原语 — 每个环消费者运行的共享步骤生成原语(ReduceShardInPlaceEnqueueDmaInGranules、sflag 握手)。
  • 扭曲概述 — 此构建器在环配置发射后进入的扭曲环面拓扑。