blob: 31b7687a7d033f29b9347ed1b4fec569bc1610ab [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
79
Jan Eilers53ca2e52021-02-02 13:18:09 +000080### Partially supported
Ryan OSheaf3a43232020-02-12 16:15:27 +000081
82- Conv
Jan Eilers1121c6b2021-02-19 09:38:03 +000083 - The parser only supports 2D convolutions with a group = 1 or group = #Nb_of_channel (depthwise convolution)
Ryan OSheaf3a43232020-02-12 16:15:27 +000084- BatchNormalization
85 - 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.
86- MatMul
87 - The parser only supports constant weights in a fully connected layer.
88
89## Tested networks
90
91Arm tested these operators with the following ONNX fp32 neural networks:
Jan Eilers53ca2e52021-02-02 13:18:09 +000092- Mobilenet_v2. See the ONNX [MobileNet documentation](https://github.com/onnx/models/tree/master/vision/classification/mobilenet) for more information.
93- 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 +000094
95More machine learning operators will be supported in future releases.
96<br/><br/><br/><br/>
97
Jan Eilers53ca2e52021-02-02 13:18:09 +000098
99
100
Jan Eilers3309c332021-08-17 13:50:08 +0100101@section S6_tf_lite_parser Arm NN Tf Lite Parser
Ryan OSheaf3a43232020-02-12 16:15:27 +0000102
103`armnnTfLiteParser` is a library for loading neural networks defined by TensorFlow Lite FlatBuffers files
104into the Arm NN runtime.
105
106## TensorFlow Lite operators that the Arm NN SDK supports
107
108This reference guide provides a list of TensorFlow Lite operators the Arm NN SDK currently supports.
109
Jan Eilers53ca2e52021-02-02 13:18:09 +0000110### Fully supported
Ryan OSheaf3a43232020-02-12 16:15:27 +0000111The Arm NN SDK TensorFlow Lite parser currently supports the following operators:
112
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100113- ABS
Ryan OSheaf3a43232020-02-12 16:15:27 +0000114- ADD
Matthew Sloyan28f177c2021-04-09 14:38:52 +0100115- ARG_MAX
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100116- ARG_MIN
Ryan OSheaf3a43232020-02-12 16:15:27 +0000117- AVERAGE_POOL_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
118- BATCH_TO_SPACE
119- CONCATENATION, Supported Fused Activation: RELU , RELU6 , TANH, NONE
120- CONV_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
Jan Eilers53ca2e52021-02-02 13:18:09 +0000121- DEPTH_TO_SPACE
Ryan OSheaf3a43232020-02-12 16:15:27 +0000122- DEPTHWISE_CONV_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
James Ward590f3f72020-12-02 10:20:48 +0000123- DEQUANTIZE
Darshan Patel42b3d7d2020-05-25 22:30:07 +0530124- DIV
Jan Eilers53ca2e52021-02-02 13:18:09 +0000125- ELU
Bruno Goncalves2d0eb862021-07-11 14:10:15 -0300126- EQUAL
Ryan OSheaeb1f9cf2020-05-21 17:07:40 +0100127- EXP
Matthew Sloyane369dbd2021-08-19 12:05:44 +0100128- EXPAND_DIMS
Ryan OSheaf3a43232020-02-12 16:15:27 +0000129- FULLY_CONNECTED, Supported Fused Activation: RELU , RELU6 , TANH, NONE
Jan Eilers53ca2e52021-02-02 13:18:09 +0000130- GATHER
Bruno Goncalves2d0eb862021-07-11 14:10:15 -0300131- GREATER
132- GREATER_EQUAL
Jan Eilers53ca2e52021-02-02 13:18:09 +0000133- HARD_SWISH
134- LEAKY_RELU
Bruno Goncalves2d0eb862021-07-11 14:10:15 -0300135- LESS
136- LESS_EQUAL
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100137- LOGICAL_NOT
Ryan OSheaf3a43232020-02-12 16:15:27 +0000138- LOGISTIC
139- L2_NORMALIZATION
140- MAX_POOL_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
141- MAXIMUM
142- MEAN
143- MINIMUM
Jan Eilers1121c6b2021-02-19 09:38:03 +0000144- MUL
Darshan Patel83fcf982020-05-26 22:22:42 +0530145- NEG
Bruno Goncalves2d0eb862021-07-11 14:10:15 -0300146- NOT_EQUAL
Ryan OSheaf3a43232020-02-12 16:15:27 +0000147- PACK
148- PAD
Narumol Prangnawarat4a4af112021-05-25 14:26:24 +0100149- PRELU
James Ward590f3f72020-12-02 10:20:48 +0000150- QUANTIZE
Ryan OSheaf3a43232020-02-12 16:15:27 +0000151- RELU
152- RELU6
Jan Eilers1121c6b2021-02-19 09:38:03 +0000153- REDUCE_MAX
154- REDUCE_MIN
Ryan OSheaf3a43232020-02-12 16:15:27 +0000155- RESHAPE
156- RESIZE_BILINEAR
James Ward590f3f72020-12-02 10:20:48 +0000157- RESIZE_NEAREST_NEIGHBOR
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100158- RSQRT
Matthew Sloyane369dbd2021-08-19 12:05:44 +0100159- SHAPE
Ryan OSheaf3a43232020-02-12 16:15:27 +0000160- SLICE
161- SOFTMAX
162- SPACE_TO_BATCH
163- SPLIT
Ryan OShea86704732020-05-26 11:41:04 +0100164- SPLIT_V
Ryan OSheaf3a43232020-02-12 16:15:27 +0000165- SQUEEZE
166- STRIDED_SLICE
167- SUB
Jan Eilers1121c6b2021-02-19 09:38:03 +0000168- SUM
Ryan OSheaf3a43232020-02-12 16:15:27 +0000169- TANH
170- TRANSPOSE
171- TRANSPOSE_CONV
172- UNPACK
173
Jan Eilers53ca2e52021-02-02 13:18:09 +0000174### Custom Operator
Ryan OSheaf3a43232020-02-12 16:15:27 +0000175- TFLite_Detection_PostProcess
176
177## Tested networks
Ryan OSheaf3a43232020-02-12 16:15:27 +0000178Arm tested these operators with the following TensorFlow Lite neural network:
179- [Quantized MobileNet](http://download.tensorflow.org/models/mobilenet_v1_2018_02_22/mobilenet_v1_1.0_224_quant.tgz)
180- [Quantized SSD MobileNet](http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18.tar.gz)
181- DeepSpeech v1 converted from [TensorFlow model](https://github.com/mozilla/DeepSpeech/releases/tag/v0.4.1)
182- DeepSpeaker
James Ward590f3f72020-12-02 10:20:48 +0000183- [DeepLab v3+](https://www.tensorflow.org/lite/models/segmentation/overview)
184- FSRCNN
185- EfficientNet-lite
186- RDN converted from [TensorFlow model](https://github.com/hengchuan/RDN-TensorFlow)
187- Quantized RDN (CpuRef)
188- [Quantized Inception v3](http://download.tensorflow.org/models/tflite_11_05_08/inception_v3_quant.tgz)
189- [Quantized Inception v4](http://download.tensorflow.org/models/inception_v4_299_quant_20181026.tgz) (CpuRef)
190- Quantized ResNet v2 50 (CpuRef)
191- Quantized Yolo v3 (CpuRef)
Ryan OSheaf3a43232020-02-12 16:15:27 +0000192
193More machine learning operators will be supported in future releases.
Ryan OSheaf3a43232020-02-12 16:15:27 +0000194
195**/
196}
Ryan OShea2bbfaa72020-02-12 16:15:27 +0000197