分层重打包:无需额外重分布通路的变长混合注意力训练
Layerwise Repacking: Variable-Length Hybrid-Attention Training without an Extra Redistribution Pass
AI总结:
该研究提出分层重打包方法,无需额外重分布通路即可实现变长混合注意力训练,在1F3S模型的22个训练步骤中,可降低端到端时间并提升MFU。
摘要:
变长训练会在混合注意力模型的各层间产生冲突的并行性需求:最长样本需要16或32个秩的宽序列并行(SP)组以实现全注意力,其成本随序列长度呈二次增长;而受近线性MoE工作主导的稀疏注意力层,可在节点本地的SP8组内平衡大部分评估工作负载。若将宽组复用至这些层,会导致跨节点的全对全通信,观测到的有效速率低7.0倍;而切换为更小的组会改变每个样本的所属秩,在每个全-稀疏边界进行单独重分布会引入额外数据传输。分层重打包为全注意力保留每个SP16/32父组,并将其样本重打包为节点本地的SP{1,2,4,8}稀疏子组,隐藏状态在全层间保持;布局变化依托现有两个全层Ulysses站点实现:每个站点处,一次可变大小的全对全操作同时完成头交换和样本重打包,无需添加额外重分布通路。由于子组可达到的平衡取决于共享父组的样本,辅助父组求解器会在子组形成前重新平衡父组成员。在1F3S混合注意力模型(每3个稀疏注意力层对应1个全注意力层)的前200个训练步骤中,所有22个含SP16/32父组的步骤里,仅重打包就使平均端到端时间较禁用重打包的基线降低5.95%,模型FLOPs利用率(MFU)提升3.75个百分点;结合改进的求解器后,端到端时间降低7.61%,MFU提升4.83个百分点。
英文摘要:
Variable-length training creates conflicting parallelism requirements across the layers of a hybrid-attention model. The longest samples require wide sequence-parallel (SP) groups of 16 or 32 ranks for full attention, whose cost grows quadratically with sequence length. Sparse-attention layers, dominated by near-linear MoE work, can instead balance most evaluated workloads within node-local SP8 groups. Reusing the wide groups for these layers pushes their all-to-all communication across nodes, where the observed effective rate is 7.0x lower. Yet switching to smaller groups changes which ranks own each sample; a separate redistribution at every full-sparse boundary would introduce another data transfer. Layerwise Repacking keeps each SP16/32 parent for full attention and repacks its samples into node-local sparse children at SP{1, 2, 4, 8}, where hidden states persist between full layers. The layout change rides on the two existing full-layer Ulysses sites: at each, one variable-size all-to-all performs both the head exchange and the sample repacking, so no redistribution pass is added. Because the balance the children can reach depends on which samples share a parent, an auxiliary parent solver rebalances parent membership before the children are formed. On all 22 steps with SP16/32 parents among the first 200 training steps of a 1F3S hybrid-attention model (one full-attention layer per three sparse-attention layers), repacking alone reduces the mean end-to-end time by 5.95% and raises model FLOPs utilization (MFU) by 3.75 percentage points over the baseline with repacking disabled; with the improved solver, end-to-end time falls by 7.61% and MFU rises by 4.83 percentage points.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。