blob: 39fe536fe9bb5f9de198ed29530c73c855787136 [file] [log] [blame]
Teresa Charlinfd33a692022-06-29 15:35:57 +01001/// Copyright (c) 2022 Arm Ltd and Contributors. All rights reserved.
Ryan OSheaf3a43232020-02-12 16:15:27 +00002///
3/// SPDX-License-Identifier: MIT
4///
Ryan OSheaf3a43232020-02-12 16:15:27 +00005
6namespace armnn
7{
8/**
9@page parsers Parsers
10
11@tableofcontents
Jan Eilersb6578192021-01-28 09:13:24 +000012Execute models from different machine learning platforms efficiently with our parsers. Simply choose a parser according
Kevin Mayeb03e0f2021-04-28 16:16:22 +010013to the model you want to run e.g. If you've got a model in onnx format (<model_name>.onnx) use our onnx-parser.
Jan Eilersb6578192021-01-28 09:13:24 +000014
Jan Eilers53ca2e52021-02-02 13:18:09 +000015If you would like to run a Tensorflow Lite (TfLite) model you probably also want to take a look at our @ref delegate.
Jan Eilers31a7c892021-01-29 14:18:13 +000016
17All parsers are written in C++ but it is also possible to use them in python. For more information on our python
Jan Eilers53ca2e52021-02-02 13:18:09 +000018bindings take a look into the @ref md_python_pyarmnn_README section.
Jan Eilers31a7c892021-01-29 14:18:13 +000019
Kevin Mayeb03e0f2021-04-28 16:16:22 +010020<br/><br/>
Ryan OSheaf3a43232020-02-12 16:15:27 +000021
Jan Eilers53ca2e52021-02-02 13:18:09 +000022
23
24
Jan Eilers3309c332021-08-17 13:50:08 +010025@section S5_onnx_parser Arm NN Onnx Parser
Ryan OSheaf3a43232020-02-12 16:15:27 +000026
27`armnnOnnxParser` is a library for loading neural networks defined in ONNX protobuf files into the Arm NN runtime.
28
29## ONNX operators that the Arm NN SDK supports
30
31This reference guide provides a list of ONNX operators the Arm NN SDK currently supports.
32
33The Arm NN SDK ONNX parser currently only supports fp32 operators.
34
Jan Eilers53ca2e52021-02-02 13:18:09 +000035### Fully supported
Ryan OSheaf3a43232020-02-12 16:15:27 +000036
37- Add
38 - See the ONNX [Add documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Add) for more information
Ryan OSheab23b9992020-04-23 15:45:04 +010039
Ryan OShea2bbfaa72020-02-12 16:15:27 +000040- AveragePool
Ryan OSheaf3a43232020-02-12 16:15:27 +000041 - See the ONNX [AveragePool documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#AveragePool) for more information.
Ryan OSheab23b9992020-04-23 15:45:04 +010042
Narumol Prangnawaratbc3bb622021-09-24 16:08:34 +010043- Concat
44 - See the ONNX [Concat documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Concat) for more information.
45
Ryan OSheaf3a43232020-02-12 16:15:27 +000046- Constant
47 - See the ONNX [Constant documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Constant) for more information.
Ryan OSheab23b9992020-04-23 15:45:04 +010048
49- Clip
50 - See the ONNX [Clip documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Clip) for more information.
51
52- Flatten
53 - See the ONNX [Flatten documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Flatten) for more information.
54
Narumol Prangnawaratf10b15a2021-09-17 21:08:57 +010055- Gather
56 - See the ONNX [Gather documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Gather) for more information.
57
Ryan OSheaf3a43232020-02-12 16:15:27 +000058- GlobalAveragePool
59 - See the ONNX [GlobalAveragePool documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#GlobalAveragePool) for more information.
Ryan OSheab23b9992020-04-23 15:45:04 +010060
61- LeakyRelu
62 - See the ONNX [LeakyRelu documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LeakyRelu) for more information.
63
Ryan OSheaf3a43232020-02-12 16:15:27 +000064- MaxPool
65 - See the ONNX [max_pool documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#MaxPool) for more information.
Ryan OSheab23b9992020-04-23 15:45:04 +010066
Ryan OSheaf3a43232020-02-12 16:15:27 +000067- Relu
68 - See the ONNX [Relu documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Relu) for more information.
Ryan OSheab23b9992020-04-23 15:45:04 +010069
Ryan OSheaf3a43232020-02-12 16:15:27 +000070- Reshape
71 - See the ONNX [Reshape documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Reshape) for more information.
72
Narumol Prangnawaratf10b15a2021-09-17 21:08:57 +010073- Shape
74 - See the ONNX [Shape documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Shape) for more information.
75
Ryan OSheab23b9992020-04-23 15:45:04 +010076- Sigmoid
77 - See the ONNX [Sigmoid documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sigmoid) for more information.
78
79- Tanh
80 - See the ONNX [Tanh documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Tanh) for more information.
81
Narumol Prangnawaratfe6aa2f2021-09-23 16:11:17 +010082- Unsqueeze
83 - See the ONNX [Unsqueeze documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Unsqueeze) for more information.
Ryan OSheab23b9992020-04-23 15:45:04 +010084
Jan Eilers53ca2e52021-02-02 13:18:09 +000085### Partially supported
Ryan OSheaf3a43232020-02-12 16:15:27 +000086
87- Conv
Jan Eilers1121c6b2021-02-19 09:38:03 +000088 - The parser only supports 2D convolutions with a group = 1 or group = #Nb_of_channel (depthwise convolution)
Ryan OSheaf3a43232020-02-12 16:15:27 +000089- BatchNormalization
90 - The parser does not support training mode. See the ONNX [BatchNormalization documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#BatchNormalization) for more information.
Narumol Prangnawarat1112b012021-09-30 12:10:50 +010091- Gemm
92 - The parser only supports constant bias or non-constant bias where bias dimension = 1. See the ONNX [Gemm documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Gemm) for more information.
Ryan OSheaf3a43232020-02-12 16:15:27 +000093- MatMul
Teresa Charlind69cb902021-11-08 17:28:51 +000094 - The parser only supports constant weights in a fully connected layer. See the ONNX [MatMul documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#MatMul) for more information.
Ryan OSheaf3a43232020-02-12 16:15:27 +000095
96## Tested networks
97
98Arm tested these operators with the following ONNX fp32 neural networks:
Jan Eilers53ca2e52021-02-02 13:18:09 +000099- Mobilenet_v2. See the ONNX [MobileNet documentation](https://github.com/onnx/models/tree/master/vision/classification/mobilenet) for more information.
100- Simple MNIST. This is no longer directly documented by ONNX. The model and test data may be downloaded [from the ONNX model zoo](https://onnxzoo.blob.core.windows.net/models/opset_8/mnist/mnist.tar.gz).
Ryan OSheaf3a43232020-02-12 16:15:27 +0000101
102More machine learning operators will be supported in future releases.
103<br/><br/><br/><br/>
104
Jan Eilers53ca2e52021-02-02 13:18:09 +0000105
106
107
Jan Eilers3309c332021-08-17 13:50:08 +0100108@section S6_tf_lite_parser Arm NN Tf Lite Parser
Ryan OSheaf3a43232020-02-12 16:15:27 +0000109
110`armnnTfLiteParser` is a library for loading neural networks defined by TensorFlow Lite FlatBuffers files
111into the Arm NN runtime.
112
113## TensorFlow Lite operators that the Arm NN SDK supports
114
115This reference guide provides a list of TensorFlow Lite operators the Arm NN SDK currently supports.
116
Jan Eilers53ca2e52021-02-02 13:18:09 +0000117### Fully supported
Ryan OSheaf3a43232020-02-12 16:15:27 +0000118The Arm NN SDK TensorFlow Lite parser currently supports the following operators:
119
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100120- ABS
Ryan OSheaf3a43232020-02-12 16:15:27 +0000121- ADD
Matthew Sloyan28f177c2021-04-09 14:38:52 +0100122- ARG_MAX
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100123- ARG_MIN
Ryan OSheaf3a43232020-02-12 16:15:27 +0000124- AVERAGE_POOL_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
125- BATCH_TO_SPACE
126- CONCATENATION, Supported Fused Activation: RELU , RELU6 , TANH, NONE
127- CONV_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
Matthew Sloyaneb5f8102021-10-05 17:31:42 +0100128- CONV_3D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
Jan Eilers53ca2e52021-02-02 13:18:09 +0000129- DEPTH_TO_SPACE
Ryan OSheaf3a43232020-02-12 16:15:27 +0000130- DEPTHWISE_CONV_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
James Ward590f3f72020-12-02 10:20:48 +0000131- DEQUANTIZE
Darshan Patel42b3d7d2020-05-25 22:30:07 +0530132- DIV
Jan Eilers53ca2e52021-02-02 13:18:09 +0000133- ELU
Bruno Goncalves2d0eb862021-07-11 14:10:15 -0300134- EQUAL
Ryan OSheaeb1f9cf2020-05-21 17:07:40 +0100135- EXP
Matthew Sloyane369dbd2021-08-19 12:05:44 +0100136- EXPAND_DIMS
Teresa Charlincdbd40b2022-02-25 13:21:55 +0000137- FLOOR_DIV
Ryan OSheaf3a43232020-02-12 16:15:27 +0000138- FULLY_CONNECTED, Supported Fused Activation: RELU , RELU6 , TANH, NONE
Jan Eilers53ca2e52021-02-02 13:18:09 +0000139- GATHER
Teresa Charlin91a53ea2022-04-25 15:47:29 +0100140- GATHER_ND
Bruno Goncalves2d0eb862021-07-11 14:10:15 -0300141- GREATER
142- GREATER_EQUAL
Jan Eilers53ca2e52021-02-02 13:18:09 +0000143- HARD_SWISH
144- LEAKY_RELU
Bruno Goncalves2d0eb862021-07-11 14:10:15 -0300145- LESS
146- LESS_EQUAL
Teresa Charlin28aa6692022-07-12 11:18:44 +0100147- LOG
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100148- LOGICAL_NOT
Ryan OSheaf3a43232020-02-12 16:15:27 +0000149- LOGISTIC
Teresa Charlinfd33a692022-06-29 15:35:57 +0100150- LOG_SOFTMAX
Ryan OSheaf3a43232020-02-12 16:15:27 +0000151- L2_NORMALIZATION
152- MAX_POOL_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
153- MAXIMUM
154- MEAN
155- MINIMUM
Matthew Sloyanaf3a4ef2021-10-22 15:48:12 +0100156- MIRROR_PAD
Jan Eilers1121c6b2021-02-19 09:38:03 +0000157- MUL
Darshan Patel83fcf982020-05-26 22:22:42 +0530158- NEG
Bruno Goncalves2d0eb862021-07-11 14:10:15 -0300159- NOT_EQUAL
Ryan OSheaf3a43232020-02-12 16:15:27 +0000160- PACK
161- PAD
Mike Kelly0d77ae12022-01-07 17:42:27 +0000162- PADV2
Narumol Prangnawarat4a4af112021-05-25 14:26:24 +0100163- PRELU
James Ward590f3f72020-12-02 10:20:48 +0000164- QUANTIZE
Ryan OSheaf3a43232020-02-12 16:15:27 +0000165- RELU
166- RELU6
Jan Eilers1121c6b2021-02-19 09:38:03 +0000167- REDUCE_MAX
168- REDUCE_MIN
Teresa Charlind69cb902021-11-08 17:28:51 +0000169- REDUCE_PROD
Ryan OSheaf3a43232020-02-12 16:15:27 +0000170- RESHAPE
171- RESIZE_BILINEAR
James Ward590f3f72020-12-02 10:20:48 +0000172- RESIZE_NEAREST_NEIGHBOR
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100173- RSQRT
Matthew Sloyane369dbd2021-08-19 12:05:44 +0100174- SHAPE
Teresa Charlin28aa6692022-07-12 11:18:44 +0100175- SIN
Ryan OSheaf3a43232020-02-12 16:15:27 +0000176- SLICE
177- SOFTMAX
178- SPACE_TO_BATCH
179- SPLIT
Ryan OShea86704732020-05-26 11:41:04 +0100180- SPLIT_V
Ryan OSheaf3a43232020-02-12 16:15:27 +0000181- SQUEEZE
Teresa Charlinf0fce5b2022-05-04 17:24:43 +0100182- SQRT
Ryan OSheaf3a43232020-02-12 16:15:27 +0000183- STRIDED_SLICE
184- SUB
Jan Eilers1121c6b2021-02-19 09:38:03 +0000185- SUM
Ryan OSheaf3a43232020-02-12 16:15:27 +0000186- TANH
187- TRANSPOSE
188- TRANSPOSE_CONV
189- UNPACK
190
Jan Eilers53ca2e52021-02-02 13:18:09 +0000191### Custom Operator
Ryan OSheaf3a43232020-02-12 16:15:27 +0000192- TFLite_Detection_PostProcess
193
194## Tested networks
Ryan OSheaf3a43232020-02-12 16:15:27 +0000195Arm tested these operators with the following TensorFlow Lite neural network:
196- [Quantized MobileNet](http://download.tensorflow.org/models/mobilenet_v1_2018_02_22/mobilenet_v1_1.0_224_quant.tgz)
197- [Quantized SSD MobileNet](http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18.tar.gz)
198- DeepSpeech v1 converted from [TensorFlow model](https://github.com/mozilla/DeepSpeech/releases/tag/v0.4.1)
199- DeepSpeaker
James Ward590f3f72020-12-02 10:20:48 +0000200- [DeepLab v3+](https://www.tensorflow.org/lite/models/segmentation/overview)
201- FSRCNN
202- EfficientNet-lite
203- RDN converted from [TensorFlow model](https://github.com/hengchuan/RDN-TensorFlow)
204- Quantized RDN (CpuRef)
205- [Quantized Inception v3](http://download.tensorflow.org/models/tflite_11_05_08/inception_v3_quant.tgz)
206- [Quantized Inception v4](http://download.tensorflow.org/models/inception_v4_299_quant_20181026.tgz) (CpuRef)
207- Quantized ResNet v2 50 (CpuRef)
208- Quantized Yolo v3 (CpuRef)
Ryan OSheaf3a43232020-02-12 16:15:27 +0000209
210More machine learning operators will be supported in future releases.
Ryan OSheaf3a43232020-02-12 16:15:27 +0000211
212**/
213}
Ryan OShea2bbfaa72020-02-12 16:15:27 +0000214