arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2512.20968cs.DCcs.AI
收藏

Mesh-Attention: 一种新的通信高效分布式注意力机制,具有改进的数据本地性

Mesh-Attention: A New Communication-Efficient Distributed Attention with Improved Data Locality

Tsinghua University(清华大学);Purdue University(普渡大学);University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);ByteDance Seed(字节跳动种子)

Sirui Chen, Jingji Chen, Siqi Zhu, Ziheng Jiang, Yanghua Peng, Xuehai Qian

AI总结:

Mesh-Attention通过改进的数据本地性,提高了分布式注意力的通信效率和可扩展性,实验显示在大规模GPU上实现了显著的加速和通信量减少。

摘要:

分布式注意力是扩展大型语言模型(LLMs)上下文窗口的根本问题。最先进的方法Ring-Attention由于其过量的通信流量而受到可扩展性限制。本文提出了一种新的分布式注意力算法Mesh-Attention,通过重新思考分布式注意力的设计空间,采用新的矩阵模型。我们的方法将二维瓷砖分配给每个GPU,而不是一维行或列,通过降低通信计算(CommCom)比率来实现更高的效率。通用方法涵盖了Ring-Attention作为特殊情况,并允许通过不同的瓷砖形状调节CommCom比率。重要的是,我们提出了一种贪心算法,可以高效地在瓷砖内搜索调度空间,同时确保GPU之间的高效通信。理论分析表明,Mesh-Attention导致通信复杂性显著降低,并与其他当前算法相比表现出良好的可扩展性。我们的广泛实验结果表明,Mesh-Attention可以在256个GPU上实现高达3.4倍的加速(平均2.9倍)并减少通信量高达85.4%(平均79.0%)。我们的可扩展性结果进一步表明,Mesh-Attention在系统扩展时仍能保持优越性能,显著减少大规模部署中的开销。结果有力地证实了Mesh-Attention的优势。

英文摘要:

Distributed attention is essential for scaling large language models (LLMs) to long contexts, yet existing methods either have limited parallelism or incur high communication costs. Ulysses uses efficient all-to-all communication but cannot scale beyond the number of attention heads, whereas Ring-Attention removes this limit at the cost of high per-GPU communication. In our analytical Q-KV interaction matrix model, Ring-Attention assigns each GPU an entire row, preserving Q locality while sacrificing KV locality. Each GPU therefore receives nearly all KV partitions, and its communication grows linearly with sequence length. We present Mesh-Attention, which instead assigns each GPU a 2D tile to balance Q and KV locality, so that it collects only subsets of Q and KV partitions. This gives Mesh-Attention asymptotically lower communication complexity than Ring-Attention without limiting parallelism. Mesh-Attention further uses KV Partition Rotation (KVR), greedy scheduling, and topology-aware GPU mapping to balance traffic, overlap communication with computation, and reduce traffic over low-bandwidth links. Across experiments on up to 256 GPUs and 1M-token sequences, Mesh-Attention achieves average speedups of 17.00x, 2.62x and 2.94x (up to 32.27x, 4.36x and 4.59x) over Ring-Attention, USP (Ulysses degree 8) and StarTrail, respectively. It maintains this performance advantage as GPU count and sequence length increase while substantially reducing communication overhead at scale.

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

↑