Skip to content

CMSIS_NN integration

Context

#6 This merge request contains tools for exporting quantized neural networks to Arm Cortex M targets, using the Arm CMSIS_NN library.

It contains :

  • New templates for generating code (Fully Connected, Conv, Max Pooling, Relu)
  • A merge of the Conv Relu Scaling and Fully Connected Relu Scaling nodes
  • A function to convert a scaling parameter into a shift and a multiply.
  • Unit tests in the form of small layer exports, with expected outputs in the console

This export is optimized for CMSIS_NN 6.0

For the moment, only 8-bit quantization is available; a 4-bit and 16-bit version will soon be available.

Note: several TODOs remain, including a Datatype problem not yet solved, an input problem after quantization, etc.

Modified files

  • operator.py add Cmsis_nn option for many operators
  • export.py, merging operator, copy CMSIS_nn files, delete identity layer

TODO

  • Int4 Int16 for CMSIS_NN
  • Use get_opertor.Datatype()
  • No input after quantization
  • Operator LSTM, Softmax, SVDF, Reshape
Edited by Grégoire Kubler

Merge request reports