面向NPU的高效多尺度可变形注意力研究
Towards Efficient Multi-Scale Deformable Attention on NPU
AI总结:
针对多尺度可变形注意力在NPU上的优化难题,本文提出面向昇腾NPU的软硬件协同设计方法,通过内存与计算策略重构及硬件感知优化,实现了显著优于基线与厂商库的训练全流程加速。
摘要:
多尺度可变形注意力(MSDA)是视觉任务中一种灵活且强大的特征提取机制,但其随机访问网格采样策略带来了显著的优化挑战,在NPU等专用加速器上尤为突出。本文提出一种协同设计方法,针对昇腾NPU架构系统性地重新规划MSDA的内存访问与计算策略。该方法实现的版本同时支持高效的前向与反向计算,完全适配训练工作负载,并整合了一系列硬件感知优化技术。大量实验表明,相较于基于网格采样的基线方案,本文方案的前向加速比最高达5.9倍、反向加速比最高达8.9倍、端到端训练加速比最高达7.3倍;相较于最新的厂商库,三者加速比分别为1.9倍、2.4倍和2.0倍。
英文摘要:
Multi-scale deformable attention (MSDA) is a flexible and powerful feature extraction mechanism for visual tasks, but its random-access grid sampling strategy poses significant optimization challenges, especially on domain-specific accelerators such as NPUs. In this work, we present a co-design approach that systematically rethinks memory access and computation strategies for MSDA on the Ascend NPU architecture. With this co-design approach, our implementation supports both efficient forward and backward computation, is fully adapted for training workloads, and incorporates a suite of hardware-aware optimizations. Extensive experiments show that our solution achieves up to $5.9\times$ (forward), $8.9\times$ (backward), and $7.3\times$ (end-to-end training) speedup over the grid sample-based baseline, and $1.9\times$, $2.4\times$, and $2.0\times$ acceleration over the latest vendor library, respectively.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。