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

Zen-Attention:用于AMD NPU上动态注意力折叠的编译器框架

Zen-Attention: A Compiler Framework for Dynamic Attention Folding on AMD NPUs

Aadesh Deshmukh, Venkata Yaswanth Raparti, Samuel Hsu

AI总结:

针对Transformer模型在AMD NPU部署中动态注意力层映射效率低的问题,提出Zen-Attention编译器框架,通过探索层折叠等设计空间优化DRAM带宽利用率,使注意力块延迟提升达4倍、端到端延迟提升达32%。

摘要:

基于Transformer的深度学习模型正越来越多地部署在笔记本电脑和游戏机等受能量及DRAM带宽限制的设备上,这为满足模型的延迟要求带来了重大挑战。业界正转向神经处理单元(NPU)以获得更优的每瓦性能(perf/watt);然而,将动态注意力层高效映射到NPU上仍是一项具有挑战性的任务。为优化每瓦性能,AMD XDNA NPU采用软件管理的缓存,并与主机共享系统内存。这需要大量工程工作来实现高效的分块、缓冲区分配和数据移动,以从设备中提取最大效率。本文介绍了Zen-Attention,这是一个通过系统探索层折叠、分块、互连数据移动以及张量布局的复杂设计空间来优化模型注意力层中DRAM带宽利用率的框架,以得出最优解决方案。我们的评估包括对端到端模型延迟和每个模型中特定注意力延迟的比较分析。我们展示了该框架如何通过改变输入维度来增强映射能力,这些输入维度需要在注意力块中进行填充和掩码。对于代表性的Transformer模型,与基线Unfolded方法相比,Zen-Attention框架实现了注意力块延迟高达4倍的提升,以及端到端网络延迟高达32%的提升。

英文摘要:

Transformer-based deep learning models are increasingly deployed on energy, and DRAM bandwidth constrained devices such as laptops and gaming consoles, which presents significant challenges in meeting the latency requirements of the models. The industry is turning to neural processing units (NPUs) for superior performance-per-watt (perf/watt); however, efficiently mapping dynamic attention layers to the NPUs remains a challenging task. For optimizing perf/watt, AMD XDNA NPUs employ software managed caches and share system memory with host. This requires substantial engineering effort to unlock efficient tiling, buffer allocation, and data movement to extract the maximum efficiency from the device. This paper introduces Zen-Attention, a framework that optimizes DRAM bandwidth utilization in the attention layer of models by systematically exploring the complex design space of layer folding, tiling, and data-movement on the interconnect, and the tensor layouts to come up with an optimal solution. Our evaluation includes comparative analysis of end-to-end model latency and specific attention latency in each model. We demonstrate how the framework enhances mapping capabilities by varying input dimensions, which require padding and masking in the attention block. For representative transformer models, the Zen-Attention Framework achieves up to 4x improvement in the latency of the attention block and up to 32% improvement in end-to-end network latency compared to the baseline Unfolded- approaches.

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

↑