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

FlyWheel:专为TPU设计的注意力核

FlyWheel: Attention Kernels Built for the TPU

New York University(纽约大学);New York University Shanghai(纽约大学上海分校);Google(谷歌)

Zishuo Bao, Zeshen Zhang, Linkun Chen, Yucheng Lu

AI总结:

FlyWheel是专为TPU设计的注意力核,通过优化计算与数据布局提升MXU利用率,在TPU v6e、v7x上使softmax注意力等任务提速,集成vLLM服务Qwen3.8-27B时也提升了预填充吞吐量且精度相当。

摘要:

张量处理单元(TPU)上的注意力核常因重复加载矩阵操作数、密集向量计算及依赖关系导致矩阵单元(MXU)闲置,未能充分利用MXU。本文提出FlyWheel,一组适用于softmax注意力和线性注意力的快速TPU核。FlyWheel通过重构softmax与三角逆运算减少向量工作量,协调数据布局提升矩阵操作数复用,还重叠独立计算以隐藏执行延迟。将这些技术应用于TPU v6e和v7x上的softmax注意力与门控DeltaNet,FlyWheel使softmax注意力较最先进的RPA核提速最高达4.14倍,较Splash Attention提速1.80倍,在v6e上达到峰值BF16吞吐量的81%;还使门控DeltaNet预填充提速最高达3.61倍。集成到vLLM中服务Qwen3.8-27B时,FlyWheel在保持可比精度的同时,使预填充吞吐量提升最高达1.56倍。

英文摘要:

Attention kernels on Tensor Processing Units (TPUs) often underutilize their matrix units (MXUs) because of repeated matrix operand loads, vector-intensive computation, and dependencies that leave MXUs idle. We present FlyWheel, a set of fast TPU kernels for both softmax and linear attention. FlyWheel reformulates softmax and triangular inversion to reduce vector work, while coordinating data layouts to improve matrix operand reuse. It then overlaps independent computation to hide execution latency. We apply these techniques to both softmax attention and Gated DeltaNet on TPU v6e and v7x. FlyWheel speeds up softmax attention by up to $4.14\times$ over the state-of-the-art RPA kernel and $1.80\times$ over Splash Attention, reaching 81% of peak BF16 throughput on v6e. It also speeds up Gated DeltaNet prefill by up to $3.61\times$. Integrated into vLLM serving Qwen3.8-27B, FlyWheel improves prefill throughput by up to $1.56\times$ while maintaining comparable accuracy.

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

↑