arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2611.06828cs.LG
收藏

脉动线性注意力:为TPU协同设计分块门控增量注意力

Systolic Linear Attention: Co-Designing Tile-Grouped Gated Delta Attention for TPUs

Google(谷歌)

Gagik Amirkhanyan, Nuojin Cheng

AI总结:

该研究针对TPU架构设计SLA,通过重构门控增量注意力解决GPU适配层在TPU上的效率问题,在TPU v7x上实现训练速度提升与更优困惑度表现。

摘要:

门控增量线性注意力层如Gated DeltaNet(GDN)、Kimi Delta Attention(KDA)和GDN-2是为GPU优化的,GPU拥有小张量核心分块和快速向量寄存器,使得逐通道衰减重缩放和块内顺序求解成本低廉。而谷歌TPU将计算集中在宽256×256的脉动矩阵单元,该单元由速度较慢的向量单元支撑,直接移植这些层会导致每个矩阵分块一半闲置,并在向量操作上形成瓶颈。我们提出脉动线性注意力(Systolic Linear Attention, SLA),它通过将键扩展为256并结合分组值头、将衰减门分组为四个64通道分块、在单个融合内核中完全通过块矩阵乘积计算分块求解,围绕矩阵单元重构门控增量注意力。在TPU v7x上,完整的SLA-R4层比开源Tokamax KDA内核快1.6倍至2.5倍(精确分块逆时为1.4倍至2.4倍),主要得益于头共享和内核融合。在对65亿至631亿参数的稀疏混合专家(MoE)模型进行的2048芯片TPU v7x预训练研究中,SLA在相似困惑度下比KDA快11%至24%,且在较小的匹配种子运行中达到略低的困惑度。

英文摘要:

Gated-delta linear attention layers such as Gated DeltaNet (GDN), Kimi Delta Attention (KDA), and GDN-2 are tuned for GPUs, where small tensor-core tiles and fast vector registers make per-channel decay rescaling and sequential in-block solves cheap. On Google TPUs, which concentrate compute in wide $256 \times 256$ systolic matrix units backed by a slower vector unit, porting these layers directly leaves half of each matrix tile empty and bottlenecks on vector operations. We present \textbf{Systolic Linear Attention (SLA)}, which reshapes gated delta attention around the matrix unit by widening keys to $256$ with grouped value heads, grouping decay gates into four $64$-channel tiles, and computing the chunk solve entirely with block matrix products in a single fused kernel. On TPU v7x, a full \texttt{SLA-R4} layer runs $1.6\times$--$2.5\times$ faster than the open-source Tokamax KDA kernel ($1.4\times$--$2.4\times$ with exact chunk inversion), driven primarily by head sharing and kernel fusion. Across a $2{,}048$-chip TPU v7x pre-training study of sparse Mixture-of-Experts (MoE) models from $6.5\text{B}$ to $63.1\text{B}$ parameters, SLA trains $11\%$--$24\%$ faster than KDA at similar perplexity, and reaches slightly lower perplexity than KDA in smaller matched-seed runs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑