arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.12736cs.CVcs.AIcs.AR
收藏

CHOSEN:面向高效 Vision Transformer 推理的硬件优化栈编译框架

CHOSEN: Compilation to Hardware Optimization Stack for Efficient Vision Transformer Inference

University of Southern California(美国南加州大学)

Mohammad Erfan Sadeghi, Arash Fayyazi, Suhas Somashekar, Armin Abdollahi, Massoud Pedram

AI总结:

本文提出软硬件协同设计框架 CHOSEN,通过多核并行、非线性函数近似和编译器设计空间探索,自动化优化 FPGA 上的 ViT 推理,在 DeiT-S 与 DeiT-B 上分别取得 1.5 倍和 1.42 倍吞吐量提升。

摘要:

Vision Transformer(ViT)代表了计算机视觉机器学习方法的一项突破性转变。与传统方法不同,ViT 采用已在自然语言处理中广泛使用的自注意力机制来分析图像块。尽管 ViT 在视觉任务建模方面具有优势,但将其部署到硬件平台(尤其是 Field-Programmable Gate Array,FPGA)上会带来相当大的挑战。这些挑战主要源于 ViT 的非线性计算以及高昂的计算和内存需求。本文提出 CHOSEN,这是一个软硬件协同设计框架,旨在应对这些挑战,并提供一个用于在 FPGA 上部署 ViT 的自动化框架,以最大化性能。该框架建立在三项基础性贡献之上:多核设计,主要利用多个 DDR 存储体的优势来最大化带宽;近似非线性函数,在精度下降极小的同时高效使用 FPGA 上可用的逻辑块;以及高效编译器,通过提出一种用于设计空间探索的新算法来寻找实现最佳吞吐量和延迟的最优硬件配置,从而最大化计算核的性能和内存效率。与最先进的 ViT 加速器相比,CHOSEN 在 DeiT-S 和 DeiT-B 模型上分别实现了 1.5 倍和 1.42 倍的吞吐量提升。

英文摘要:

Vision Transformers (ViTs) represent a groundbreaking shift in machine learning approaches to computer vision. Unlike traditional approaches, ViTs employ the self-attention mechanism, which has been widely used in natural language processing, to analyze image patches. Despite their advantages in modeling visual tasks, deploying ViTs on hardware platforms, notably Field-Programmable Gate Arrays (FPGAs), introduces considerable challenges. These challenges stem primarily from the non-linear calculations and high computational and memory demands of ViTs. This paper introduces CHOSEN, a software-hardware co-design framework to address these challenges and offer an automated framework for ViT deployment on the FPGAs in order to maximize performance. Our framework is built upon three fundamental contributions: multi-kernel design to maximize the bandwidth, mainly targeting benefits of multi DDR memory banks, approximate non-linear functions that exhibit minimal accuracy degradation, and efficient use of available logic blocks on the FPGA, and efficient compiler to maximize the performance and memory-efficiency of the computing kernels by presenting a novel algorithm for design space exploration to find optimal hardware configuration that achieves optimal throughput and latency. Compared to the state-of-the-art ViT accelerators, CHOSEN achieves a 1.5x and 1.42x improvement in the throughput on the DeiT-S and DeiT-B models.

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

↑