Skip to main content
QUICK REVIEW

[Paper Review] CMSIS-NN: Efficient Neural Network Kernels for Arm Cortex-M CPUs

Oliveira, Afonso, Costa, Diogo|arXiv (Cornell University)|Jan 19, 2018
Advanced Neural Network ApplicationsComputer Science6 references304 citations
TL;DR

This paper presents CMSIS-NN, a set of highly optimized neural network kernels for Arm Cortex-M CPUs, enabling efficient inference of quantized deep neural networks on resource-constrained IoT devices. By leveraging fixed-point quantization (8-bit and 16-bit), SIMD-optimized matrix multiplication, in-situ pooling, and SWAR-based activation functions, CMSIS-NN achieves 4.6X higher throughput and 4.9X better energy efficiency on a CIFAR-10 CNN compared to baseline implementations.

ABSTRACT

Deep Neural Networks are becoming increasingly popular in always-on IoT edge devices performing data analytics right at the source, reducing latency as well as energy consumption for data communication. This paper presents CMSIS-NN, efficient kernels developed to maximize the performance and minimize the memory footprint of neural network (NN) applications on Arm Cortex-M processors targeted for intelligent IoT edge devices. Neural network inference based on CMSIS-NN kernels achieves 4.6X improvement in runtime/throughput and 4.9X improvement in energy efficiency.

Motivation & Objective

  • To enable efficient deep neural network inference on energy-constrained Arm Cortex-M microcontrollers used in IoT edge devices.
  • To minimize memory footprint and computational overhead for deploying neural networks on 32-bit RISC processors without FPU support.
  • To develop a software stack that supports fixed-point quantization and efficient kernel execution across diverse neural network layers.
  • To achieve high performance and energy efficiency for real-time edge AI workloads on low-end embedded systems.

Proposed method

  • Employing 8-bit and 16-bit fixed-point quantization with power-of-two scaling to avoid floating-point operations and reduce memory usage.
  • Using CMSIS-optimized data type conversions (q7_t to q15_t) with sign extension and minimal reordering to accelerate inner-loop computations.
  • Implementing 2×2 blocked matrix multiplication using the SMLAD SIMD instruction for efficient MAC operations on q15_t data.
  • Introducing in-situ split x-y pooling to eliminate temporary memory allocation and achieve 4.5X speed-up over window-based pooling.
  • Applying SWAR-based bit manipulation to accelerate ReLU operations by using sign-bit masking via QSUB8 instruction.
  • Using table-lookup-based sigmoid and tanh functions with region-specific granularity to balance accuracy and performance on integer-only CPUs.

Experimental results

Research questions

  • RQ1How can deep neural network inference be efficiently executed on Arm Cortex-M CPUs with limited memory and no FPU?
  • RQ2What fixed-point quantization strategy maximizes performance and accuracy while minimizing computational cost on integer-only processors?
  • RQ3Can in-situ pooling and optimized matrix multiplication reduce memory footprint and improve throughput in embedded neural networks?
  • RQ4To what extent can SWAR-based implementations of activation functions improve performance on 8-bit data types?
  • RQ5How does the overall kernel stack compare to baseline implementations in terms of throughput and energy efficiency?

Key findings

  • CMSIS-NN kernels achieve 4.6X higher throughput and 4.9X better energy efficiency on a CIFAR-10 CNN compared to baseline implementations using standard CMSIS-DSP functions.
  • The optimized CNN runs at 10.1 images per second on an Arm Cortex-M7 at 216 MHz, achieving 79.9% accuracy with only 133 KB of peak memory usage.
  • In-situ split x-y pooling provides a 4.5X speed-up with no additional memory overhead compared to traditional window-based pooling.
  • The ReLU kernel achieves approximately 4X speed-up over conventional scalar implementations using SWAR techniques on 8-bit data.
  • The use of power-of-two scaling in quantization eliminates the need for floating-point de-quantization, enabling full integer computation on CPUs without FPU support.
  • Partial im2col transformation reduces memory footprint from 332 KB to 133 KB, making the network feasible on the NUCLEO-F746ZG board.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.