Introduction
In the pursuit of energy-efficient Deep Learning (DL) hardware, quantization has become a standard technique. While the industry has successfully transitioned weights and activations to 8-bit (INT8) or lower formats, a significant energy bottleneck remains: Partial Sums (PSUMs).
When hardware accelerators execute large-scale matrix multiplications—particularly those found in Transformer architectures—the operations are broken into tiles. The intermediate results, or PSUMs, must be stored and subsequently retrieved to be accumulated with the next tile's result. To prevent overflow and maintain numerical stability across deep accumulation paths (which can exceed 4096 elements), these PSUMs are typically stored in high-precision 32-bit formats. In common dataflows such as Input Stationary (IS) or Weight Stationary (WS), the movement of these 32-bit PSUMs between the processing array and memory can account for up to 69% of total power consumption.
APSQ (Additive Partial Sum Quantization) introduces a novel algorithm-hardware co-design that slashes this energy cost by quantizing PSUMs to 8-bit integers with negligible impact on model accuracy.
The APSQ Framework
APSQ departs from traditional quantization methods that occur after an operation is completed. Instead, it integrates the accumulation process directly into the quantization framework through three primary innovations:
- Recursive Quantization: APSQ determines the next quantized partial sum by considering both the current high-precision tile and the dequantized version of the previous sum. This feedback loop helps manage the precision loss during the accumulation process.
- Hardware-Friendly Scaling: To maintain hardware simplicity, APSQ forces scaling factors to be powers-of-two. This allows the hardware to replace expensive multiplication operations with simple, energy-efficient bit-shifts.
- Grouping Strategy: The authors identified that quantizing at every single step (group size $gs=1$) leads to "rounding error drift," where small errors accumulate and eventually degrade model performance. By implementing a grouping strategy—where multiple PSUM tiles are accumulated in high precision before being quantized as a group—the model can recover nearly all lost accuracy while still achieving significant energy savings.
Hardware Implementation: The RAE
To support this algorithm, the authors designed the Reconfigurable APSQ Engine (RAE). This hardware module is designed to be integrated into existing accelerators, adding only approximately 3.21% to the total hardware area. Synthesized at 28-nm technology, the RAE uses four SRAM banks and a multi-stage adder pipeline to dynamically adjust to different group sizes ($gs$), allowing for a flexible trade-off between precision and power.
Experimental Evaluation
The effectiveness of APSQ was tested across a diverse set of benchmarks and models:
- Natural Language Processing: BERT-Base evaluated on the GLUE benchmark (QNLI, MNLI, MRPC).
- Computer Vision: Segformer-B0 and EfficientViT-B1 evaluated on the ADE20K semantic segmentation dataset.
- Large Language Models: LLaMA2-7B evaluated on zero-shot Common Sense Reasoning tasks (BoolQ, PIQA, HellaSwag).
Key Results
- Accuracy Preservation: For BERT-Base, the average accuracy drop was only 0.16%. Computer vision models saw an mIoU (mean Intersection over Union) drop of less than 1%.
- Energy Efficiency: APSQ achieved 28-87% energy savings for BERT and CV models. The most dramatic result was seen with LLaMA2-7B, which achieved a 31.7x energy saving in Weight Stationary dataflows with only a 0.59% average accuracy drop.
- Dataflow Sensitivity: The study found that while APSQ is highly effective for Weight Stationary (WS) dataflows, it provides minimal enhancement for LLMs using Input Stationary (IS) dataflows during the decoding stage, as the PSUM movement is less of a bottleneck in those specific configurations.
Conclusion and Future Work
APSQ demonstrates that the high-precision requirement for partial sums can be bypassed through clever algorithm-hardware co-design. By shrinking PSUMs from 32-bit to 8-bit, the framework addresses one of the most significant remaining power drains in AI accelerators. Future research will focus on scaling APSQ to models larger than 7B parameters and exploring its compatibility with 4-bit (INT4) weight quantization and alternative attention mechanisms.
Summary updated