CMSIS-NN  
CMSIS NN Software Library
CMSIS NN Software Library

Introduction

This user manual describes the CMSIS NN software library, a collection of efficient neural network kernels developed to maximize the performance and minimize the memory footprint of neural networks on Arm Cortex-M processors.

The library is divided into a number of functions each covering a specific category:

Supported Processors

CMSIS-NN targets Cortex-M processors with typically three different implementations for each function. Each targets a different group of processors.

  • Processors without Single Instruction Multiple Data(SIMD) capability (e.g, Cortex-M0)
  • Processors with DSP extension (e.g Cortex-M4)
  • Processors with Arm M-Profile Vector Extension(MVE) instructions (e.g Cortex-M55) The right implementation is picked through feature flags and the user does not have to explicit set it.

Quantization Specification

The library follows the int8 and int16 quantization specification of TensorFlow Lite for Microcontrollers.

Block Diagram

Examples

An example image recognition application using TensorFlow Flow Lite for Microcontrollers as an inference engine and CMSIS-NN as the optimized library can be found in the Examples directory.

Pre-processor Macros

Feature flag based

The macros below are defined in a build system based on feature flags for a chosen processor or architecture input to a compiler. These tie in to the classification in Pre-processor Macros.

For a CMSIS-NN file compiled as armclang -mcpu=cortex-m4 –target=arm-arm-none-eabi -I<CMSIS Core Include> -Ofast -O file.c , ARM_MATH_DSP is enabled as Cortex-M4 has the DSP extension as a feature.

  • ARM_MATH_DSP - Selects code for processors with DSP extension.
  • ARM_MATH_MVEI - Selects code for processors which supports MVE instructions.

User Set

  • ARM_MATH_AUTOVECTORIZE Applicable when ARM_MATH_MVEI is active to let the compiler auto vectorize functions, if available, that uses inline assembly. This has to be explicitly set at compile time.

Inclusive Language

This product confirms to Arm’s inclusive language policy and, to the best of our knowledge, does not contain any non-inclusive language. If you find something that concerns you, email terms.nosp@m.@arm.nosp@m..com.

Copyright Notice

SPDX-FileCopyrightText: Copyright 2010-2023 Arm Limited and/or its affiliates open-.nosp@m.sour.nosp@m.ce-of.nosp@m.fice.nosp@m.@arm..nosp@m.com