🤖 AI Summary
This work addresses the high hardware overhead of the softmax operation in Vision Transformers when deployed on small-scale FPGAs, where exponential computation and normalization impose stringent area and power constraints unsuitable for edge devices. The authors propose a BRAM-free approximate attention weighting unit that implements a 16-segment piecewise linear approximation of the natural exponential function entirely using distributed LUTs—a first on FPGA—while preserving the pre-trained model’s temperature parameter and eliminating the need for recalibration. Implemented on a Xilinx Zynq-7020, the complete attention row-computation core occupies only 1,444 LUTs and 77 DSPs, achieving a Top-1 accuracy degradation of no more than 0.20% absolute compared to exact softmax, thereby significantly enhancing energy efficiency for edge AI applications.
📝 Abstract
Vision Transformers have reshaped computer vision by using self-attention to capture global context across image regions. This makes them attractive for edge visual inspection and monitoring in applications such as renewable-energy infrastructure, industrial quality control, medical imaging, and autonomous-system sensing. However, deploying ViTs on small FPGAs remains challenging because the softmax stage in self-attention requires exponential evaluation and normalization, which are costly in hardware. Existing implementations often rely on CORDIC pipelines or BRAM-based look-up tables, increasing area and power consumption. This paper presents a BRAM-free approximate attention-weighting unit for FPGA-based ViT inference. The proposed design approximates the natural exponential in softmax using a 16-segment piecewise-linear function implemented entirely with distributed LUT fabric. Unlike base-2 approximations, the natural-exponential formulation preserves the pre-trained attention temperature and avoids model-specific recalibration. Implemented on a Xilinx Zynq-7020, the complete attention-row core uses 1444 LUTs, 77 DSPs, and no BRAM, while hardware-accurate emulation shows accuracy within a \(0.20\%\) absolute top-1 difference from the exact-softmax reference on ViT-family models. These results demonstrate the potential of the proposed core for energy-efficient ViT inference on resource-constrained edge-AI platforms.