Skip to main content
QUICK REVIEW

[Paper Review] VAQF: Fully Automatic Software-Hardware Co-Design Framework for Low-Bit Vision Transformer

Mengshu Sun, Haoyu Ma|arXiv (Cornell University)|Jan 17, 2022
Advanced Image and Video Retrieval TechniquesComputer Science28 citations
TL;DR

VAQFAutomatically designs FPGA-based ViT accelerators for binary-weight, low-precision ViTs, achieving real-time FPS targets with a compilation-guided quantization strategy.

ABSTRACT

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.

Motivation & Objective

  • Motivate efficient deployment of Vision Transformers on edge devices by reducing model size and computation via quantization.
  • Propose a fully automatic framework that outputs activation precision and accelerator settings to meet a target frame rate.
  • Integrate binary weights with low-precision activations to balance accuracy and throughput.
  • Demonstrate FPGA-based ViT acceleration using Vivado HLS on Xilinx boards.

Proposed method

  • Introduce VAQF flow that takes ViT structure and target FPS to determine activation precision via a compilation step.
  • Quantize ViT weights to binary and activations to low precision, guided by hardware feasibility.
  • Develop a compute engine for FC and multi-head attention with loop tiling, data packing, and LUT-based arithmetic for binary weights.
  • Implement layer-specific optimization and FPGA data-path design to maximize throughput under BRAM/DSP/LUT constraints.
  • Use a binary search over activation precision to satisfy the FPS target and generate corresponding accelerator parameters.
  • Evaluate implementations with Vivado HLS on ZCU102 using DeiT-base, reporting FPS requirements met at 24 FPS (8-bit activations) and 30 FPS (6-bit activations).

Experimental results

Research questions

  • RQ1Can a fully automatic framework determine the activation precision needed to meet a specified frame rate for quantized ViTs on FPGAs?
  • RQ2What hardware-software co-design strategies enable real-time ViT inference with binary weights and low-precision activations on FPGA platforms?
  • RQ3How does VAQF balance accuracy vs. throughput across different activation precisions for ViT models?
  • RQ4What is the impact of data packing, tiling, and LUT-based computation on FPGA resource utilization for quantized ViTs?

Key findings

  • Binary-weights ViT with full-precision activations achieves 79.5% top-1 accuracy on ImageNet-1K (validation) with a 2.3% drop from the full-precision 81.8% model.
  • 8-bit activations maintain 77.6% accuracy, enabling 24 FPS on the target FPGA board.
  • 6-bit activations achieve 76.5% accuracy, enabling 30 FPS on the target FPGA board.
  • VAQF's compilation step quickly determines activation precision and accelerator settings, requiring minutes to hours (much less than typical quantization training time).
  • The FPGA accelerator uses LUT-based computations for binary weights, with data packing and tiling to maximize throughput and reduce BRAM usage.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.