The Hidden Bottleneck in NPU Inference
In the realm of deep learning hardware acceleration, quantization is the standard strategy for maximizing efficiency. Industry practice typically squeezes weights and activations into 8-bit integers (W8A8). However, a significant, often overlooked bottleneck remains: partial sums (psums).
When a systolic array—the computational engine inside a TPU or NPU—performs matrix multiplication, it accumulates products. To maintain mathematical precision, these intermediate psums frequently balloon to 24 or 32 bits. Hardware simulations reveal that at 32-bit precision, psum storage and movement account for over 80% of the output-related energy. Moving these high-precision numbers between the compute core and the memory buffer consumes a massive amount of energy, often dominating the total power budget.
Standard quantization techniques fail to address this because psum distributions are "heavy-tailed," featuring extreme outliers that shift depending on the input. Static scaling (using fixed ranges) leads to massive precision errors. Conversely, traditional dynamic scaling (finding the maximum value in real-time) requires complex hardware that introduces latency, ultimately negating the energy savings it aims to achieve.
Introducing PsumQuant
To solve this, researchers propose PsumQuant, a post-training, input-aware quantization framework designed to compress psums down to 8 bits without sacrificing accuracy or speed. Its core innovation is a look-ahead scale predictor.
Input-Aware Prediction and The Tiling Effect
A key insight of this research is the "Tiling Effect." Smaller hardware tiles (e.g., $32 \times 32$ arrays) suffer disproportionately from outliers. In larger tiles, the Central Limit Theorem naturally smooths the distribution, but in smaller tiles, outliers remain raw and jagged, making quantization difficult.
However, the researchers discovered that these outliers are deterministic. The maximum psum value in a tile has a correlation coefficient as high as $0.85$ with the maximum input activation. PsumQuant exploits this by projecting input activations onto a small, learnable vector to predict the optimal quantization scale for the psums before the math is even executed. By leveraging the "crest factor" (peak-to-average ratio) of the input activations, the system can accurately guess the required psum range.
Hardware-Software Co-Design
Instead of relying on a slow "max-finder" circuit, PsumQuant integrates directly into the hardware architecture. It utilizes one extra column in the systolic array to compute the scale in parallel with the primary matrix multiplication. This elegant co-design results in zero-latency overhead and requires less than 2% of the total systolic array area and power.
Fast, Layer-wise Calibration
Unlike Quantization-Aware Training (QAT), which demands expensive and time-consuming model retraining, PsumQuant employs a lightweight calibration step. It optimizes the Mean Squared Error (MSE) for each layer independently using a tiny subset of data (e.g., just 16 sequences for a Large Language Model). To ensure accuracy, the method introduces a "nonzero crest factor" ($\kappa_{nz}$) to weight the gradients during calibration. This forces the predictor to be highly accurate on tiles containing extreme outliers, which are the primary culprits behind accuracy degradation. Remarkably, this calibration takes less than an hour on a single consumer-grade GPU (like an RTX 6000).
Performance and Results
PsumQuant was rigorously evaluated across a variety of architectures, including Computer Vision models (ResNet, Swin-Transformer on ImageNet) and LLMs (Llama-3.1, Phi-3, Qwen-2.5 on WikiText-2 and zero-shot benchmarks).
The results demonstrate a massive leap in efficiency:
- Energy Savings: On a $128 \times 128$ systolic array, compressing psums to 8 bits reduced total inference energy by 45%.
- Near-Lossless Accuracy: ResNet-18 maintained its performance with less than a 1% drop in Top-1 accuracy. Similarly, Llama-3.1 (8B) achieved 8-bit psum quantization with a marginal 0.04 increase in perplexity.
Limitations and Future Directions
While PsumQuant offers a highly efficient solution for current integer-based NPUs, the authors note a few areas for future exploration. The current framework focuses on integer quantization, and extending it to "microscaling" formats (like MXFP4/8) that use block-shared exponents is a logical next step. Additionally, while 8-bit compression works beautifully, pushing to extreme ultra-low precision (e.g., 6-bit) widens the gap between PsumQuant and ideal dynamic scaling, suggesting room for improving the predictor's robustness. Finally, adapting the method for more exotic hardware dataflows beyond Weight-Stationary and Output-Stationary designs remains an open challenge.
Summary updated