Abstract
Transformer-based models have established a new state-of-the-art in natural language processing and computer vision. However, their deployment on edge devices is constrained by high computational complexity and memory requirements. While quantization to 8-bit integers (INT8) is a common optimization, non-linear operations like Softmax and Layer Normalization typically require de-quantization back to floating-point arithmetic, creating significant hardware overhead. This paper presents SwiftTron, a specialized ASIC hardware accelerator designed for end-to-end integer-only Transformer inference. By utilizing polynomial approximations and dyadic arithmetic, SwiftTron eliminates the need for floating-point units, achieving a 3.81x speedup over high-end GPUs with a power consumption of only 33.64 mW.
1. Introduction
Modern Transformer architectures, such as BERT, RoBERTa, and GPT, rely heavily on Multi-Head Self-Attention (MHSA) and Feed-Forward Networks (FFN). While these models offer superior accuracy, their massive parameter counts make them difficult to deploy on "EdgeAI" or "tinyML" platforms like smartwatches and mobile sensors.
A primary bottleneck in accelerating these models is the "Floating-Point Tax." Standard quantization techniques convert weights and activations to INT8 for matrix multiplications, but non-linear functions—specifically Softmax, GELU, and LayerNorm—are mathematically complex. Most existing hardware accelerators perform these operations by de-quantizing data back to 32-bit floating-point (FP32), which requires expensive hardware logic and increases latency. SwiftTron addresses this by proposing a holistic, integer-only computation flow.
2. Methodology
SwiftTron introduces several architectural innovations to maintain high throughput and low power within the integer domain.
2.1 Integer-Only Computation Flow
Instead of the traditional cycle of quantization and de-quantization, SwiftTron employs a Requantization scheme. Intermediate results are maintained in INT32 precision. Scaling factors are then applied to bring these values back to INT8 for the subsequent layer without ever invoking floating-point logic.
2.2 Mathematical Approximations
To handle transcendental functions without floating-point units, the authors implemented the following:
- Polynomial Approximations: Complex functions such as $e^x$ (used in Softmax) and the error function (used in GELU) are replaced by second-order polynomial approximations. This reduces complex math to simple integer additions and multiplications.
- Recursive Square Root: For Layer Normalization, a hardware-efficient recursive algorithm calculates square roots using only integer shifts and additions.
- Dyadic Arithmetic: To avoid the silicon area cost of hardware dividers, scaling factors are represented as dyadic numbers (a whole number multiplied by a power of two). This allows the hardware to replace division with simple bit-shifting operations.
2.3 Hardware Architecture
The design was synthesized using a 65 nm CMOS process. It features a Column-Oriented Data Flow, processing matrices one column at a time. This design choice simplifies the interface between hardware blocks (e.g., moving from Matrix Multiplication directly into Softmax) and significantly reduces the requirement for large intermediate buffers.
3. Experimental Evaluation
3.1 Setup
The researchers evaluated SwiftTron using two primary benchmarks:
- SST-2 (GLUE benchmark): Testing RoBERTa-base and RoBERTa-large for natural language sentiment analysis.
- ImageNet: Testing the Data-efficient Image Transformer (DeiT-S) for computer vision tasks.
3.2 Performance and Efficiency
The synthesized SwiftTron architecture demonstrated significant improvements over general-purpose hardware:
- Latency: SwiftTron executes a RoBERTa-base model in 1.83 ms, representing a 3.81x speedup compared to an NVIDIA RTX 2080 Ti GPU.
- Power and Area: The entire chip consumes just 33.64 mW and occupies an area of 273 mm² at the 65nm node.
- Accuracy: Despite the use of integer approximations, accuracy loss was negligible. RoBERTa-base maintained a 95.2% accuracy on the SST-2 task, proving the robustness of the polynomial approximation method.
3.3 Resource Distribution
Analysis of the silicon area reveals that while Matrix Multiplication (MatMul) units occupy 55% of the area, the non-linear units (Softmax and LayerNorm) account for approximately 42%. This highlights that even with integer-only optimizations, these "secondary" operations remain a major focus for hardware efficiency.
4. Conclusion and Future Work
SwiftTron demonstrates that eliminating floating-point units can reclaim massive amounts of silicon real estate and power—an FP32 multiplier is roughly 41x larger and more power-hungry than an INT8 counterpart. By providing a complete end-to-end pipeline, SwiftTron offers a viable path for deploying state-of-the-art Transformers on power-constrained edge devices.
Future work may involve adapting the design for modern 7nm or 5nm technology nodes, which would likely yield even more dramatic efficiency gains. Additionally, exploring dynamic scaling factors and on-device training (backpropagation) support remains an open area for research.
Summary updated