NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Automatic Generation of High-Performance Convolution Kernels on ARM CPUs for Deep Learning

Jintao Meng, Chen Zhuang, Peng Chen, Mohamed Wahib, Bertil Schmidt, Xiao Wang, Haidong Lan, Dou Wu, Minwen Deng, Yanjie Wei, Shengzhong Feng

Introduction

Convolutional layers represent the primary computational bottleneck in Deep Learning, often accounting for over 95% of total compute load. While the Winograd algorithm theoretically offers superior efficiency by reducing arithmetic operations by up to 5x, its practical implementation on ARM CPUs is hindered by extreme hardware diversity and irregular matrix shapes. The ARM ecosystem spans from low-power mobile SoCs to high-performance server chips like AWS Graviton2, each with unique cache hierarchies and register counts. Standard BLAS libraries, optimized for large square matrices, often fail to deliver peak performance on the "skinny" or "long" matrices typical of Winograd transformations.

FastConv: Automated Kernel Generation

To address these challenges, we present FastConv, an open-source, template-based library that automatically generates high-performance Winograd convolution kernels tailored to specific ARM architectures. Unlike traditional libraries that rely on hand-tuned assembly, FastConv utilizes a novel "TensorGEMM" approach combined with automated search.

FastConv optimization and generation workflow

The system optimizes kernels across four key dimensions:

  1. Tile Transformation & Fusion: Reduces redundant memory access by fusing data packing and transformation steps.
  2. Parameterized Cache Blocking: Dynamically adjusts data blocking to fit the L1/L2 cache sizes of the target CPU.
  3. Register Blocking: Tailors the use of ARM Neon SIMD registers (32 registers in ARMv8) to maximize instruction-level parallelism.
  4. Loop Reordering: Optimizes computation order to maximize cache residency.

An empirical auto-tuning process explores thousands of configurations to identify the optimal parameters for a given hardware target and convolution shape.

Performance Evaluation

FastConv was benchmarked using convolutional layers from six major CNN architectures: VGG-16, GoogLeNet, ResNet-50, MobileNet-V1, Inception-V3, and Inception-V4. These models represent a diverse range of real-world deep learning workloads.

Roofline analysis of performance across various ARM architectures

Results demonstrate that FastConv consistently outperforms industry-standard libraries like NNPACK and ARM NN. On the Kunpeng 920, FastConv achieved speedups of up to 2.17x over ARM NN. Portability tests on VGG-16 showed even more dramatic gains: 2.26x on the Apple M1 and a staggering 11.02x on AWS Graviton2 compared to NNPACK. Crucially, FastConv enables kernels to reach near-theoretical peak performance, whereas existing libraries often utilize only a fraction of the hardware's potential.

Conclusion and Future Work

By treating the inner compute as a specialized "TensorGEMM" and leveraging C++ templates for portability, FastConv overcomes the limitations of manual tuning in the fragmented ARM ecosystem. While currently focused on FP32 precision, future work will extend these templates to support FP16 and Int8 arithmetic. Additionally, reducing the offline auto-tuning search time remains a priority for streamlining deployment.

Summary updated

BibTeX
@article{meng2022automatic,
  author = {Jintao Meng and Chen Zhuang and Peng Chen and Mohamed Wahib and Bertil Schmidt and Xiao Wang and Haidong Lan and Dou Wu and Minwen Deng and Yanjie Wei and Shengzhong Feng},
  title = {{Automatic Generation of High-Performance Convolution Kernels on ARM CPUs for Deep Learning}},
  journal = {IEEE Trans. Parallel Distributed Syst.},
  year = {2022},
  doi = {10.1109/tpds.2022.3146257},
}
Figure