Overwrite Quantization: Opportunistic Outlier Handling for Neural Network Accelerators

Ritchie Zhao, Christopher De Sa, Zhiru ZhangarXiv 2019

TL;DR

This paper introduces Overwrite Quantization (OverQ), a novel hardware technique that tackles the challenge of outliers in neural network activations during quantization. By cleverly reallocating bits from zeros to outliers, OverQ significantly improves accuracy at low bitwidths with minimal hardware overhead, making efficient inference more feasible.

What Problem Does This Paper Address?

Deep neural networks (DNNs) are computationally intensive, and reducing their size and complexity through quantization (converting floating-point numbers to lower-precision fixed-point) is crucial for deployment, especially on edge devices. However, a major hurdle in quantization is the presence of "outliers" – extreme values in weights and activations that, if not handled properly, can drastically degrade model accuracy. While fine-tuning models can address outliers, this is often impractical for ML service providers who receive pre-trained models without access to the original training data. Existing hardware solutions for outliers can be complex and add significant area overhead. This paper aims to provide a more efficient hardware solution for handling activation outliers during post-training quantization.

Methods

The core innovation is Overwrite Quantization (OverQ), a lightweight hardware technique that leverages two key properties of DNN activations: the rarity of outliers and the abundance of zeros (especially from ReLU activations). OverQ operates in two main modes:

  • Range Overwrite (RO): When an outlier is detected (a value that would be clipped by standard quantization), OverQ reallocates bits from an adjacent zero to extend the outlier's range. This effectively gives the outlier more "room" to be represented accurately.
  • Precision Overwrite (PR): Non-outlier values can also overwrite adjacent zeros to gain increased precision.

To further enhance its effectiveness, OverQ employs cascading. This allows an outlier to "cascade" its overwrite effect through a sequence of zeros, enabling it to handle outliers that are not immediately adjacent. The authors also introduce an "OverQ State" to manage these operations, which requires minimal additional logic. OverQ is designed to be integrated into existing weight-stationary systolic arrays, a common architecture in DNN accelerators.

Datasets

The paper uses the ImageNet dataset for evaluating the accuracy of quantized models, specifically mentioning its use with ResNet-18, ResNet-50, DenseNet-121, and VGG-19 models. They also mention using a small profiling dataset (1000 training images) to gather per-channel statistics for determining clipping thresholds.

Key Insights and Ideas

  • Leveraging Zeros is Key: The paper highlights that the abundance of zeros in DNN activations (especially post-ReLU) is not just a byproduct but a valuable resource that can be "repurposed" to improve outlier representation.
  • Opportunistic Bitwidth Extension: Instead of dedicating separate hardware for outliers (which incurs significant overhead), OverQ opportunistically reallocates existing bit resources, making it highly area-efficient.
  • Cascading for Broader Coverage: The cascading mechanism is crucial for extending OverQ's reach beyond immediate neighbors, significantly increasing the percentage of outliers handled.
  • Tradeoff Removal: OverQ effectively removes the typical tradeoff in quantization where improving outlier representation often degrades the accuracy of smaller values. By allowing outliers to overwrite zeros, both can be handled more effectively.
  • Low Bitwidth Advantage: OverQ is shown to be most impactful at lower activation bitwidths (e.g., 4-bit), where the problem of outliers and clipping is more pronounced.

Key Results

  • Outlier Coverage: With modest cascading, OverQ consistently handles over 90% of outliers on arbitrary layers of ResNet-50.
  • Accuracy Improvement: OverQ achieved a +5% improvement in ImageNet Top-1 accuracy on a quantized ResNet-50 at 4 bits. Across various models and quantization methods, OverQ consistently added accuracy, with some models approaching their floating-point accuracies. For example, DenseNet-121 and ResNet-18 saw a +5% boost with the STD method.
  • Hardware Overhead: An ASIC prototype demonstrated that OverQ adds only a small area increase per processing element (PE), estimated at approximately 0.50% for the full OverQ implementation. The primary overhead comes from multiplexer logic.

Limitations and Future Work

  • Limitations:
    • The effectiveness of OverQ relies on the presence of zeros adjacent to outliers, which is dependent on the activation distribution and input.
  • While OverQ is designed for hardware, the paper focuses on its integration into weight-stationary systolic arrays. Its performance on other architectures might differ.
  • The paper acknowledges that while OverQ improves accuracy, it doesn't aim to reach state-of-the-art accuracies achieved by techniques like dynamic quantization or trained quantization, which are harder to implement in hardware.
  • Future Work:
    • Expand the hardware prototype to include a full systolic array with integrated quantization, rescaling, routing, and control logic.
  • Explore optimizing the control and routing logic within the rescaling unit to enable a complete DNN accelerator.
  • Develop a more versatile accelerator that supports the full model lifecycle.

Summary updated

BibTeX
@misc{zhao2019overwrite,
  author = {Ritchie Zhao and Christopher De Sa and Zhiru Zhang},
  title = {{Overwrite Quantization: Opportunistic Outlier Handling for Neural Network Accelerators}},
  year = {2019},
  eprint = {1910.06909},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1910.06909},
}
Figure