blob: 689c062a9a2d7e984269751f5ab13f79c320c278 [file] [log] [blame]
Jan Eilers31a7c892021-01-29 14:18:13 +00001/// Copyright (c) 2021 ARM Limited 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
Ryan OSheaf3a43232020-02-12 16:15:27 +000043- Constant
44 - 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 +010045
46- Clip
47 - See the ONNX [Clip documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Clip) for more information.
48
49- Flatten
50 - See the ONNX [Flatten documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Flatten) for more information.
51
Narumol Prangnawaratf10b15a2021-09-17 21:08:57 +010052- Gather
53 - See the ONNX [Gather documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Gather) for more information.
54
Ryan OSheaf3a43232020-02-12 16:15:27 +000055- GlobalAveragePool
56 - 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 +010057
58- LeakyRelu
59 - See the ONNX [LeakyRelu documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LeakyRelu) for more information.
60
Ryan OSheaf3a43232020-02-12 16:15:27 +000061- MaxPool
62 - 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 +010063
Ryan OSheaf3a43232020-02-12 16:15:27 +000064- Relu
65 - 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 +010066
Ryan OSheaf3a43232020-02-12 16:15:27 +000067- Reshape
68 - See the ONNX [Reshape documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Reshape) for more information.
69
Narumol Prangnawaratf10b15a2021-09-17 21:08:57 +010070- Shape
71 - See the ONNX [Shape documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Shape) for more information.
72
Ryan OSheab23b9992020-04-23 15:45:04 +010073- Sigmoid
74 - See the ONNX [Sigmoid documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sigmoid) for more information.
75
76- Tanh
77 - See the ONNX [Tanh documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Tanh) for more information.
78
Narumol Prangnawaratfe6aa2f2021-09-23 16:11:17 +010079- Unsqueeze
80 - 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 +010081
Jan Eilers53ca2e52021-02-02 13:18:09 +000082### Partially supported
Ryan OSheaf3a43232020-02-12 16:15:27 +000083
84- Conv
Jan Eilers1121c6b2021-02-19 09:38:03 +000085 - The parser only supports 2D convolutions with a group = 1 or group = #Nb_of_channel (depthwise convolution)
Ryan OSheaf3a43232020-02-12 16:15:27 +000086- BatchNormalization
87 - 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.
88- MatMul
89 - The parser only supports constant weights in a fully connected layer.
90
91## Tested networks
92
93Arm tested these operators with the following ONNX fp32 neural networks:
Jan Eilers53ca2e52021-02-02 13:18:09 +000094- Mobilenet_v2. See the ONNX [MobileNet documentation](https://github.com/onnx/models/tree/master/vision/classification/mobilenet) for more information.
95- 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 +000096
97More machine learning operators will be supported in future releases.
98<br/><br/><br/><br/>
99
Jan Eilers53ca2e52021-02-02 13:18:09 +0000100
101
102
Jan Eilers3309c332021-08-17 13:50:08 +0100103@section S6_tf_lite_parser Arm NN Tf Lite Parser
Ryan OSheaf3a43232020-02-12 16:15:27 +0000104
105`armnnTfLiteParser` is a library for loading neural networks defined by TensorFlow Lite FlatBuffers files
106into the Arm NN runtime.
107
108## TensorFlow Lite operators that the Arm NN SDK supports
109
110This reference guide provides a list of TensorFlow Lite operators the Arm NN SDK currently supports.
111
Jan Eilers53ca2e52021-02-02 13:18:09 +0000112### Fully supported
Ryan OSheaf3a43232020-02-12 16:15:27 +0000113The Arm NN SDK TensorFlow Lite parser currently supports the following operators:
114
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100115- ABS
Ryan OSheaf3a43232020-02-12 16:15:27 +0000116- ADD
Matthew Sloyan28f177c2021-04-09 14:38:52 +0100117- ARG_MAX
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100118- ARG_MIN
Ryan OSheaf3a43232020-02-12 16:15:27 +0000119- AVERAGE_POOL_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
120- BATCH_TO_SPACE
121- CONCATENATION, Supported Fused Activation: RELU , RELU6 , TANH, NONE
122- CONV_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
Jan Eilers53ca2e52021-02-02 13:18:09 +0000123- DEPTH_TO_SPACE
Ryan OSheaf3a43232020-02-12 16:15:27 +0000124- DEPTHWISE_CONV_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
James Ward590f3f72020-12-02 10:20:48 +0000125- DEQUANTIZE
Darshan Patel42b3d7d2020-05-25 22:30:07 +0530126- DIV
Jan Eilers53ca2e52021-02-02 13:18:09 +0000127- ELU
Bruno Goncalves2d0eb862021-07-11 14:10:15 -0300128- EQUAL
Ryan OSheaeb1f9cf2020-05-21 17:07:40 +0100129- EXP
Matthew Sloyane369dbd2021-08-19 12:05:44 +0100130- EXPAND_DIMS
Ryan OSheaf3a43232020-02-12 16:15:27 +0000131- FULLY_CONNECTED, Supported Fused Activation: RELU , RELU6 , TANH, NONE
Jan Eilers53ca2e52021-02-02 13:18:09 +0000132- GATHER
Bruno Goncalves2d0eb862021-07-11 14:10:15 -0300133- GREATER
134- GREATER_EQUAL
Jan Eilers53ca2e52021-02-02 13:18:09 +0000135- HARD_SWISH
136- LEAKY_RELU
Bruno Goncalves2d0eb862021-07-11 14:10:15 -0300137- LESS
138- LESS_EQUAL
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100139- LOGICAL_NOT
Ryan OSheaf3a43232020-02-12 16:15:27 +0000140- LOGISTIC
141- L2_NORMALIZATION
142- MAX_POOL_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
143- MAXIMUM
144- MEAN
145- MINIMUM
Jan Eilers1121c6b2021-02-19 09:38:03 +0000146- MUL
Darshan Patel83fcf982020-05-26 22:22:42 +0530147- NEG
Bruno Goncalves2d0eb862021-07-11 14:10:15 -0300148- NOT_EQUAL
Ryan OSheaf3a43232020-02-12 16:15:27 +0000149- PACK
150- PAD
Narumol Prangnawarat4a4af112021-05-25 14:26:24 +0100151- PRELU
James Ward590f3f72020-12-02 10:20:48 +0000152- QUANTIZE
Ryan OSheaf3a43232020-02-12 16:15:27 +0000153- RELU
154- RELU6
Jan Eilers1121c6b2021-02-19 09:38:03 +0000155- REDUCE_MAX
156- REDUCE_MIN
Ryan OSheaf3a43232020-02-12 16:15:27 +0000157- RESHAPE
158- RESIZE_BILINEAR
James Ward590f3f72020-12-02 10:20:48 +0000159- RESIZE_NEAREST_NEIGHBOR
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100160- RSQRT
Matthew Sloyane369dbd2021-08-19 12:05:44 +0100161- SHAPE
Ryan OSheaf3a43232020-02-12 16:15:27 +0000162- SLICE
163- SOFTMAX
164- SPACE_TO_BATCH
165- SPLIT
Ryan OShea86704732020-05-26 11:41:04 +0100166- SPLIT_V
Ryan OSheaf3a43232020-02-12 16:15:27 +0000167- SQUEEZE
168- STRIDED_SLICE
169- SUB
Jan Eilers1121c6b2021-02-19 09:38:03 +0000170- SUM
Ryan OSheaf3a43232020-02-12 16:15:27 +0000171- TANH
172- TRANSPOSE
173- TRANSPOSE_CONV
174- UNPACK
175
Jan Eilers53ca2e52021-02-02 13:18:09 +0000176### Custom Operator
Ryan OSheaf3a43232020-02-12 16:15:27 +0000177- TFLite_Detection_PostProcess
178
179## Tested networks
Ryan OSheaf3a43232020-02-12 16:15:27 +0000180Arm tested these operators with the following TensorFlow Lite neural network:
181- [Quantized MobileNet](http://download.tensorflow.org/models/mobilenet_v1_2018_02_22/mobilenet_v1_1.0_224_quant.tgz)
182- [Quantized SSD MobileNet](http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18.tar.gz)
183- DeepSpeech v1 converted from [TensorFlow model](https://github.com/mozilla/DeepSpeech/releases/tag/v0.4.1)
184- DeepSpeaker
James Ward590f3f72020-12-02 10:20:48 +0000185- [DeepLab v3+](https://www.tensorflow.org/lite/models/segmentation/overview)
186- FSRCNN
187- EfficientNet-lite
188- RDN converted from [TensorFlow model](https://github.com/hengchuan/RDN-TensorFlow)
189- Quantized RDN (CpuRef)
190- [Quantized Inception v3](http://download.tensorflow.org/models/tflite_11_05_08/inception_v3_quant.tgz)
191- [Quantized Inception v4](http://download.tensorflow.org/models/inception_v4_299_quant_20181026.tgz) (CpuRef)
192- Quantized ResNet v2 50 (CpuRef)
193- Quantized Yolo v3 (CpuRef)
Ryan OSheaf3a43232020-02-12 16:15:27 +0000194
195More machine learning operators will be supported in future releases.
Ryan OSheaf3a43232020-02-12 16:15:27 +0000196
197**/
198}
Ryan OShea2bbfaa72020-02-12 16:15:27 +0000199