Wino Vidi Vici: Conquering Numerical Instability of 8-bit Winograd Convolution for Accurate Inference Acceleration on Edge

Pierpaolo Morì, Lukas Frickenstein, Shambhavi Balamuthu Sampath, Moritz Thoma, Nael Fasfous, Manoj Rohit Vemparala, Alexander Frickenstein, Christian Unger, Walter Stechele, Daniel Mueller-Gritschneder, Claudio PasseroneWACV 2024 · DOI

TL;DR

This paper tackles the challenge of using Winograd convolution, a technique that speeds up neural network inference, with 8-bit quantization, common on edge devices. They introduce a novel training approach combining trainable clipping factors and complex number representations to overcome the numerical instability that previously made these two techniques incompatible, achieving significant speedups without accuracy loss.

What Problem Does This Paper Address?

Convolutional Neural Networks (CNNs) are powerful but computationally intensive, making them difficult to deploy on edge devices with limited resources. Winograd convolution offers a way to reduce the number of Multiply-Accumulate (MAC) operations, thereby speeding up inference. Edge devices often rely on low-precision (e.g., 8-bit) arithmetic to improve energy efficiency and latency. However, combining Winograd convolution with 8-bit quantization leads to significant numerical instability and accuracy degradation. This is because the Winograd transform itself can amplify the range of values, and when these amplified values are then quantized to low precision, large errors are introduced. Previous attempts to address this often involved quantizing only parts of the Winograd process or using higher precision for intermediate steps, which defeats the purpose of efficient edge deployment. This paper aims to enable full 8-bit Winograd convolution for accurate and efficient inference on edge hardware.

Methods

The authors propose a novel training scheme called "Winograd-Aware Training" (WAT) that integrates Winograd convolution into the training loop. Their approach has two main components:

  1. Trainable Clipping Factors: They introduce trainable clipping factors for intermediate quantization stages within the Winograd domain. Instead of a fixed clipping range, these factors are learned during training. This helps to better exploit the limited 8-bit quantized range by focusing on the most significant data distributions and reducing rounding errors. They use a straight-through estimator (STE) for backpropagation.
  2. Complex Numbers for Winograd Transform: They leverage complex numbers to compute the Winograd transformation matrices. This results in smaller magnitude values in the transformed matrices, leading to a reduced "enlargement factor" (γ) and thus less numerical overflow. While complex operations aren't directly hardware-friendly, they show that by using complex conjugates and efficient algorithms, the number of real integer multiplications can be managed, and the benefits of reduced numerical range are significant.

These two techniques are combined to achieve full 8-bit quantization across all intermediate steps of the Winograd convolution without requiring additional hardware logic or storage.

Datasets

The paper evaluates their approach on the following datasets:

  • CIFAR-10: Used for training and evaluating ResNet-20.
  • ImageNet: Used for training and evaluating ResNet-18.
  • CityScapes: Used for training and evaluating DeepLabv3+ for semantic segmentation.

Key Insights and Ideas

  • The core conflict: Winograd acceleration and 8-bit quantization, individually beneficial for edge devices, are fundamentally at odds due to numerical instability introduced by the Winograd transform's amplification of data ranges.
  • Clipping is key, but trainable is better: Simply clipping values helps, but making these clipping factors trainable during the Winograd-aware training process allows the network to adapt and find optimal ranges, significantly improving accuracy.
  • Complex numbers as a hidden weapon: Using complex numbers for Winograd transforms, while seemingly counterintuitive for hardware, effectively reduces the numerical range amplification, mitigating instability without a prohibitive computational cost in practice.
  • Full 8-bit is achievable: The paper demonstrates that it's possible to achieve accurate Winograd acceleration with full 8-bit quantization throughout the entire process, eliminating the need for mixed-precision or partial quantization schemes.

Key Results

The proposed "Wino Vidi Vici" approach achieves significant improvements:

  • MAC Reduction:
    • ResNet-20 on CIFAR-10: 2.8× MAC reduction.
  • ResNet-18 on ImageNet: 2.1× MAC reduction.
  • DeepLabv3+ on CityScapes: 2.14× MAC reduction.
  • Accuracy: No accuracy degradation is reported compared to standard 8-bit quantized models across all tested tasks and models. In some cases, accuracy is even slightly improved.
  • Efficiency: The approach requires only one scaling factor per layer for activations and standard output quantization, and no additional hardware overhead.

Limitations and Future Work

  • Hardware Implementation: While the method enables full 8-bit Winograd, the paper focuses on the algorithmic and training aspects. The actual hardware implementation and its specific performance gains are not detailed.
  • Complex Number Overhead: Although they manage the overhead, the use of complex numbers might still introduce some computational complexity compared to purely real-valued operations, depending on the specific hardware.
  • Future Work: The paper suggests that their approach can be extended to other Winograd variants and potentially to even lower bit-widths (e.g., 4-bit), which would further push the boundaries of efficient edge AI. They also hint at exploring more complex network architectures and tasks.

Summary updated

BibTeX
@inproceedings{mori2024wino,
  author = {Pierpaolo Morì and Lukas Frickenstein and Shambhavi Balamuthu Sampath and Moritz Thoma and Nael Fasfous and Manoj Rohit Vemparala and Alexander Frickenstein and Christian Unger and Walter Stechele and Daniel Mueller-Gritschneder and Claudio Passerone},
  title = {{Wino Vidi Vici: Conquering Numerical Instability of 8-bit Winograd Convolution for Accurate Inference Acceleration on Edge}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2024},
  doi = {10.1109/wacv57701.2024.00013},
}
Figure