Efficient Residue Number System Based Winograd Convolution

Zhi Gang Liu, Matthew MattinaECCV 2020

Researchers at the Arm ML Research Lab have introduced a novel mathematical framework to address a long-standing bottleneck in deep learning optimization: the reliable deployment of Winograd convolutions on low-precision integer hardware. By integrating Residue Number Systems (RNS) with the Winograd algorithm, the team has enabled high-efficiency, exact integer arithmetic for quantized neural networks, overcoming the numerical instability that typically plagues large-scale Winograd transformations.

The Precision Paradox in Winograd Convolutions

Convolutional Neural Networks (CNNs) are the backbone of modern computer vision, but their computational cost is a significant hurdle for mobile and embedded deployment. The Winograd algorithm is a well-known optimization that reduces the number of required multiplications by transforming convolutions into a different mathematical domain.

However, standard Winograd implementations face two critical challenges:

  1. Numerical Instability: As the size of the processing "tiles" increases to maximize efficiency, the transformation matrices become ill-conditioned. This leads to significant precision errors in floating-point math.
  2. Hardware Mismatch: While Winograd typically requires high-precision floating-point (FP32) arithmetic, mobile hardware is heavily optimized for low-precision integers (INT8). Previous attempts to adapt Winograd for INT8 often relied on lossy scaling, which degrades model accuracy.

Residue Number Systems: The Path to Exactness

The authors solve these issues by shifting the entire convolution operation into a Residue Number System (RNS). In an RNS, a large number is represented as a set of remainders (residues) from several smaller, coprime numbers (moduli). For instance, in a system with moduli {7, 9}, the number 48 is represented as {6, 3}.

This shift provides a mathematical "superpower": it turns the fractions found in standard Winograd matrices into modular inverses. This allows the entire convolution to be computed using exact, low-cost integer arithmetic. Because RNS is an exact representation, the numerical instability of large Winograd tiles (such as $10 \times 10$ or $16 \times 16$) is eliminated. Developers simply need to select enough moduli to ensure the RNS dynamic range can accommodate the largest possible result of the convolution.

Arithmetic Complexity and Tile Scaling

A primary advantage of the RNS-Winograd approach is the ability to scale to larger tile sizes without losing precision. As the tile size increases, the theoretical arithmetic reduction becomes more pronounced, particularly for larger filter sizes.

Table 1: Arithmetic reduction and dynamic range requirements for different Winograd configurations.

As shown in the data above, increasing the tile size significantly boosts the arithmetic reduction. For example, moving from a $2 \times 2$ output tile to a $10 \times 10$ tile for $3 \times 3$ filters increases the reduction from $2.25\times$ to $6.26\times$. For $5 \times 5$ filters, the gains are even more dramatic, reaching up to $12.7\times$ reduction for $10 \times 10$ tiles. The "DW (bit)" column indicates the required dynamic range, showing how the RNS must expand to support these larger, more efficient transformations.

Real-World Performance and Efficiency

The researchers validated their approach using standard image classification benchmarks, including VGG16, ResNet50, and Inception (v1 and v3), all quantized to 8-bit. Tested against the ImageNet validation dataset, the RNS-Winograd approach maintained the exact top-1 accuracy of the standard INT8 baseline, proving its mathematical exactness.

Key performance highlights include:

  • Complexity Reduction: Theoretical arithmetic reductions of up to $7.03\times$ were achieved for $5 \times 5$ filters.
  • Hardware Speedup: On an Arm Cortex-A73 CPU, the implementation delivered a $2.02\times$ to $2.2\times$ improvement in inference latency for VGG16.
  • SIMD Friendliness: Because RNS operations are "carry-free" (each residue is processed independently), the algorithm is naturally optimized for the SIMD (Single Instruction, Multiple Data) units found in modern mobile CPUs.

Conclusion and Future Outlook

By leveraging the properties of modular arithmetic, this research provides a robust path for deploying high-performance Winograd convolutions on integer-only hardware. While there is some computational overhead in transforming data into and out of the RNS domain, the gains in the core convolution stage offer a net win for mobile efficiency. Future work may involve further optimizing these transformations or tailoring RNS moduli selection to specific hardware accelerators to push the boundaries of on-device AI even further.

Summary updated

BibTeX
@inproceedings{liu2020efficient,
  author = {Zhi Gang Liu and Matthew Mattina},
  title = {{Efficient Residue Number System Based Winograd Convolution}},
  booktitle = {European Conference on Computer Vision},
  year = {2020},
  doi = {10.1007/978-3-030-58529-7\_4},
}
Figure