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

VAQF:低比特视觉Transformer的全自动软硬件协同设计框架

VAQF: Fully Automatic Software-Hardware Co-Design Framework for Low-Bit Vision Transformer

Northeastern University(东北大学);University of California, Irvine(加州大学欧文分校);University of Texas at Austin(德克萨斯大学奥斯汀分校)

Mengshu Sun, Haoyu Ma, Guoliang Kang, Yifan Jiang, Tianlong Chen, Xiaolong Ma, Zhangyang Wang, Yanzhi Wang

摘要:

具有注意力机制的Transformer架构在自然语言处理(NLP)中获得了成功,并且视觉Transformer(ViTs)最近将应用领域扩展到各种视觉任务。在实现高性能的同时,ViT具有较大的模型大小和较高的计算复杂度,这阻碍了它们在边缘设备上的部署。为了在硬件上实现高吞吐量并同时保持模型精度,我们提出了VAQF,这是一个在FPGA平台上构建推理加速器的框架,用于具有二进制权重和低精度激活的量化ViT。给定模型结构和所需的帧速率,VAQF将自动输出激活所需的量化精度以及满足硬件要求的加速器的优化参数设置。在Xilinx ZCU 102 FPGA板上采用Vivado高级合成(HLS)实现,DeiT-base模型的评估结果表明,8位激活量化满足24帧/秒(FPS)的帧速率要求,6位激活量化满足30 FPS的目标。据我们所知,这是首次在全自动框架的帮助下将量化纳入FPGA上的ViT加速,以指导软件端的量化策略和硬件端的加速器实现,给定目标帧速率。与量化训练相比,编译时间成本非常小,生成的加速器显示出在FPGA上实现最先进的ViT模型实时执行的能力。

英文摘要:

The transformer architectures with attention mechanisms have obtained success in Nature Language Processing (NLP), and Vision Transformers (ViTs) have recently extended the application domains to various vision tasks. While achieving high performance, ViTs suffer from large model size and high computation complexity that hinders the deployment of them on edge devices. To achieve high throughput on hardware and preserve the model accuracy simultaneously, we propose VAQF, a framework that builds inference accelerators on FPGA platforms for quantized ViTs with binary weights and low-precision activations. Given the model structure and the desired frame rate, VAQF will automatically output the required quantization precision for activations as well as the optimized parameter settings of the accelerator that fulfill the hardware requirements. The implementations are developed with Vivado High-Level Synthesis (HLS) on the Xilinx ZCU102 FPGA board, and the evaluation results with the DeiT-base model indicate that a frame rate requirement of 24 frames per second (FPS) is satisfied with 8-bit activation quantization, and a target of 30 FPS is met with 6-bit activation quantization. To the best of our knowledge, this is the first time quantization has been incorporated into ViT acceleration on FPGAs with the help of a fully automatic framework to guide the quantization strategy on the software side and the accelerator implementations on the hardware side given the target frame rate. Very small compilation time cost is incurred compared with quantization training, and the generated accelerators show the capability of achieving real-time execution for state-of-the-art ViT models on FPGAs.

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

↑