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

UniForm:一种为边缘设备上高效 Vision Transformer 优化的复用注意力机制

UniForm: A Reuse Attention Mechanism Optimized for Efficient Vision Transformers on Edge Devices

Nota Inc.(Nota公司)

Seul-Ki Yeom, Tae-Ho Kim

AI总结:

针对 Vision Transformer 在边缘设备上的高内存与计算开销,提出共享注意力矩阵的 Reuse Attention,并构建 UniForm,在保持 ImageNet-1K 精度的同时显著提升推理速度与可扩展性。

摘要:

基于 Transformer 的架构已在多个领域取得显著成功,但由于高昂的内存和计算需求,其在边缘设备上的部署仍具挑战。本文提出一种新颖的 Reuse Attention(复用注意力)机制,专为高效内存访问和计算优化而设计,可在资源受限平台上无缝运行且不损失性能。传统多头注意力(MHA)会为每个头冗余计算独立的注意力矩阵,而 Reuse Attention 将这些计算合并为一个共享注意力矩阵,从而显著降低内存开销和计算复杂度。在 ImageNet-1K 及下游任务上的综合实验表明,利用 Reuse Attention 的所提 UniForm 模型达到了最先进的 ImageNet 分类精度,并在推理速度和内存可扩展性方面优于 Linear Attention、Flash Attention 等现有注意力机制。值得注意的是,UniForm-l 在 ImageNet-1K 上取得 76.7% 的 Top-1 精度,同时在 Jetson AGX Orin 等边缘设备上的推理时间为 21.8ms,相比竞争基准方法最高实现 5 倍加速。这些结果证明了 Reuse Attention 在高性能 GPU 和边缘平台上的通用性,为更广泛的实时应用铺平了道路。

英文摘要:

Transformer-based architectures have demonstrated remarkable success across various domains, but their deployment on edge devices remains challenging due to high memory and computational demands. In this paper, we introduce a novel Reuse Attention mechanism, tailored for efficient memory access and computational optimization, enabling seamless operation on resource-constrained platforms without compromising performance. Unlike traditional multi-head attention (MHA), which redundantly computes separate attention matrices for each head, Reuse Attention consolidates these computations into a shared attention matrix, significantly reducing memory overhead and computational complexity. Comprehensive experiments on ImageNet-1K and downstream tasks show that the proposed UniForm models leveraging Reuse Attention achieve state-of-the-art imagenet classification accuracy while outperforming existing attention mechanisms, such as Linear Attention and Flash Attention, in inference speed and memory scalability. Notably, UniForm-l achieves a 76.7% Top-1 accuracy on ImageNet-1K with 21.8ms inference time on edge devices like the Jetson AGX Orin, representing up to a 5x speedup over competing benchmark methods. These results demonstrate the versatility of Reuse Attention across high-performance GPUs and edge platforms, paving the way for broader real-time applications

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

↑