NMSIS-NN  Version 1.0.1
NMSIS NN Software Library
NMSIS NN Software Library

Introduction

This user manual describes the NMSIS NN software library, a collection of efficient neural network kernels developed to maximize the performance and minimize the memory footprint of neural networks on Nuclei N processor cores.

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

  • Convolution Functions
  • Activation Functions
  • Fully-connected Layer Functions
  • SVDF Layer Functions
  • Pooling Functions
  • Softmax Functions
  • Basic math Functions

The library has separate functions for operating on different weight and activation data types including 8-bit integers (q7_t) and 16-bit integers (q15_t). The descrition of the kernels are included in the function description. The implementation details are also described in this paper [1].

Note
Please refer to NMSIS-NN

Block Diagram

Examples

The library ships with a number of examples which demonstrate how to use the library functions.

Pre-processor Macros

Each library project have different pre-processor macros.

  • RISCV_MATH_DSP:

Define macro RISCV_MATH_DSP, If the silicon supports DSP instructions.

  • RISCV_NN_TRUNCATE:

Define macro RISCV_NN_TRUNCATE to use floor instead of round-to-the-nearest-int for the computation.

[1] CMSIS-NN: Efficient Neural Network Kernels for Arm Cortex-M CPUs https://arxiv.org/abs/1801.06601

[2] Converting a Neural Network for Arm Cortex-M with NMSIS-NN

https://developer.arm.com/solutions/machine-learning-on-arm/developer-material/how-to-guides/converting-a-neural-network-for-arm-RISC-V-with-nmsis-nn/single-page [3] https://www.tensorflow.org/lite/microcontrollers/library

[4] https://github.com/ARM-software/NMSIS_5/tree/develop/NMSIS/NN#legacy-vs-tfl-micro-compliant-apis