Refining Datapath for Microscaling ViTs

Can Xiao, Jianyi Cheng, Aaron ZhaoarXiv 2025 · DOI

Abstract

Vision Transformers (ViTs) offer state-of-the-art performance in computer vision but present significant deployment challenges on hardware due to their reliance on complex non-linear operations like Softmax and LayerNorm. This paper introduces the first open-source ViT accelerator that maps the entire transformer datapath onto FPGA hardware. By leveraging the Microscaling Integer (MXInt) data format and specialized hardware optimizations, the proposed design achieves up to a 171× speedup over standard floating-point implementations while maintaining accuracy within 1% of the baseline.

Introduction

While traditional Convolutional Neural Networks (CNNs) are dominated by simple multiply-accumulate operations, ViTs are computationally "fussy." They require high-precision handling of non-linear functions that standard integer quantization (e.g., Int8) often fails to capture, leading to accuracy degradation. Furthermore, many current accelerators offload these complex operations to a CPU, creating a communication bottleneck that severely limits throughput.

This research addresses these issues by asking: Can a smarter data format and optimized hardware datapath keep the entire ViT execution on the FPGA without sacrificing area efficiency or accuracy?

The Microscaling Integer (MXInt) Approach

The cornerstone of the solution is the Microscaling Integer (MXInt) format. Unlike standard floating-point where every number has its own exponent, MXInt allows a block of integers to share a single exponent. This hybrid approach provides the dynamic range of floating-point math with the hardware efficiency of integer arithmetic.

Figure 1: (a) Comparison of standard floating-point and MXInt formats. (b) Quantization results showing the memory density benefits of MXInt8.

As shown in Figure 1, the MXInt8 format significantly increases memory density (up to 4.99×) compared to FP32. This allows for a much larger portion of the model to be stored in on-chip memory, reducing expensive off-chip data transfers.

Hardware Architecture and Datapath Optimizations

To eliminate the CPU-FPGA "ping-pong" effect, the authors implemented three specific hardware datapath optimizations for non-linear operations:

  • LayerNorm: The design factors out the shared exponent, allowing the hardware to perform complex square roots and divisions on small integer mantissas using Look-Up Tables (LUTs) and simple bit-shifts.
  • GELU: The function is partitioned into three zones; the non-linear center is mapped to a tiny, area-efficient LUT, while the "tails" are handled with simple linear approximations.
  • Softmax: The exponential function $e^x$ is decomposed into a base-2 representation ($2^n \cdot 2^r$). This allows the hardware to use a shift operation for the integer part ($n$) and a small LUT for the fractional part ($r$).
Figure 2: The end-to-end hardware streaming architecture, mapping all transformer operations directly onto the FPGA fabric.

By implementing these operations in the same fabric as matrix multiplications (as seen in the streaming architecture in Figure 2), the design achieves true end-to-end acceleration.

Key Results

The proposed architecture was evaluated using the ImageNet dataset across the DeiT (Data-efficient Image Transformer) family. Key findings include:

  • Performance: The design achieved a minimum 93× speedup over Float16 implementations, reaching 171× for the DeiT-Base model.
  • Efficiency: Hardware area for non-linear operators was reduced by at least 16× compared to naive MXInt implementations. For instance, a Softmax implementation using only 2 bits for the fractional part was sufficient to maintain accuracy.
  • Accuracy: All optimizations remained within a strict 1% accuracy loss budget using Post-Training Quantization (PTQ), requiring no expensive model retraining.

Conclusion and Future Work

This work demonstrates that with specialized datapath refinement and the MXInt format, the full Vision Transformer can be efficiently mapped to FPGA hardware. While the current design heavily utilizes LUTs, future iterations could further optimize performance by better utilizing dedicated DSP blocks. Additionally, incorporating Quantization-Aware Training (QAT) could potentially allow for even lower bitwidths and greater area savings.

Summary updated

BibTeX
@misc{xiao2025refining,
  author = {Can Xiao and Jianyi Cheng and Aaron Zhao},
  title = {{Refining Datapath for Microscaling ViTs}},
  year = {2025},
  eprint = {2505.22194},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.22194},
}
Figure