blob: 2304e153bd7e117d7cc2fefd8cf53cf0dc9f4a85 [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
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.
91- MatMul
92 - The parser only supports constant weights in a fully connected layer.
93
94## Tested networks
95
96Arm tested these operators with the following ONNX fp32 neural networks:
Jan Eilers53ca2e52021-02-02 13:18:09 +000097- Mobilenet_v2. See the ONNX [MobileNet documentation](https://github.com/onnx/models/tree/master/vision/classification/mobilenet) for more information.
98- 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 +000099
100More machine learning operators will be supported in future releases.
101<br/><br/><br/><br/>
102
Jan Eilers53ca2e52021-02-02 13:18:09 +0000103
104
105
Jan Eilers3309c332021-08-17 13:50:08 +0100106@section S6_tf_lite_parser Arm NN Tf Lite Parser
Ryan OSheaf3a43232020-02-12 16:15:27 +0000107
108`armnnTfLiteParser` is a library for loading neural networks defined by TensorFlow Lite FlatBuffers files
109into the Arm NN runtime.
110
111## TensorFlow Lite operators that the Arm NN SDK supports
112
113This reference guide provides a list of TensorFlow Lite operators the Arm NN SDK currently supports.
114
Jan Eilers53ca2e52021-02-02 13:18:09 +0000115### Fully supported
Ryan OSheaf3a43232020-02-12 16:15:27 +0000116The Arm NN SDK TensorFlow Lite parser currently supports the following operators:
117
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100118- ABS
Ryan OSheaf3a43232020-02-12 16:15:27 +0000119- ADD
Matthew Sloyan28f177c2021-04-09 14:38:52 +0100120- ARG_MAX
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100121- ARG_MIN
Ryan OSheaf3a43232020-02-12 16:15:27 +0000122- AVERAGE_POOL_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
123- BATCH_TO_SPACE
124- CONCATENATION, Supported Fused Activation: RELU , RELU6 , TANH, NONE
125- CONV_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
Matthew Sloyaneb5f8102021-10-05 17:31:42 +0100126- CONV_3D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
Jan Eilers53ca2e52021-02-02 13:18:09 +0000127- DEPTH_TO_SPACE
Ryan OSheaf3a43232020-02-12 16:15:27 +0000128- DEPTHWISE_CONV_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
James Ward590f3f72020-12-02 10:20:48 +0000129- DEQUANTIZE
Darshan Patel42b3d7d2020-05-25 22:30:07 +0530130- DIV
Jan Eilers53ca2e52021-02-02 13:18:09 +0000131- ELU
Bruno Goncalves2d0eb862021-07-11 14:10:15 -0300132- EQUAL
Ryan OSheaeb1f9cf2020-05-21 17:07:40 +0100133- EXP
Matthew Sloyane369dbd2021-08-19 12:05:44 +0100134- EXPAND_DIMS
Ryan OSheaf3a43232020-02-12 16:15:27 +0000135- FULLY_CONNECTED, Supported Fused Activation: RELU , RELU6 , TANH, NONE
Jan Eilers53ca2e52021-02-02 13:18:09 +0000136- GATHER
Bruno Goncalves2d0eb862021-07-11 14:10:15 -0300137- GREATER
138- GREATER_EQUAL
Jan Eilers53ca2e52021-02-02 13:18:09 +0000139- HARD_SWISH
140- LEAKY_RELU
Bruno Goncalves2d0eb862021-07-11 14:10:15 -0300141- LESS
142- LESS_EQUAL
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100143- LOGICAL_NOT
Ryan OSheaf3a43232020-02-12 16:15:27 +0000144- LOGISTIC
145- L2_NORMALIZATION
146- MAX_POOL_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
147- MAXIMUM
148- MEAN
149- MINIMUM
Jan Eilers1121c6b2021-02-19 09:38:03 +0000150- MUL
Darshan Patel83fcf982020-05-26 22:22:42 +0530151- NEG
Bruno Goncalves2d0eb862021-07-11 14:10:15 -0300152- NOT_EQUAL
Ryan OSheaf3a43232020-02-12 16:15:27 +0000153- PACK
154- PAD
Narumol Prangnawarat4a4af112021-05-25 14:26:24 +0100155- PRELU
James Ward590f3f72020-12-02 10:20:48 +0000156- QUANTIZE
Ryan OSheaf3a43232020-02-12 16:15:27 +0000157- RELU
158- RELU6
Jan Eilers1121c6b2021-02-19 09:38:03 +0000159- REDUCE_MAX
160- REDUCE_MIN
Ryan OSheaf3a43232020-02-12 16:15:27 +0000161- RESHAPE
162- RESIZE_BILINEAR
James Ward590f3f72020-12-02 10:20:48 +0000163- RESIZE_NEAREST_NEIGHBOR
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100164- RSQRT
Matthew Sloyane369dbd2021-08-19 12:05:44 +0100165- SHAPE
Ryan OSheaf3a43232020-02-12 16:15:27 +0000166- SLICE
167- SOFTMAX
168- SPACE_TO_BATCH
169- SPLIT
Ryan OShea86704732020-05-26 11:41:04 +0100170- SPLIT_V
Ryan OSheaf3a43232020-02-12 16:15:27 +0000171- SQUEEZE
172- STRIDED_SLICE
173- SUB
Jan Eilers1121c6b2021-02-19 09:38:03 +0000174- SUM
Ryan OSheaf3a43232020-02-12 16:15:27 +0000175- TANH
176- TRANSPOSE
177- TRANSPOSE_CONV
178- UNPACK
179
Jan Eilers53ca2e52021-02-02 13:18:09 +0000180### Custom Operator
Ryan OSheaf3a43232020-02-12 16:15:27 +0000181- TFLite_Detection_PostProcess
182
183## Tested networks
Ryan OSheaf3a43232020-02-12 16:15:27 +0000184Arm tested these operators with the following TensorFlow Lite neural network:
185- [Quantized MobileNet](http://download.tensorflow.org/models/mobilenet_v1_2018_02_22/mobilenet_v1_1.0_224_quant.tgz)
186- [Quantized SSD MobileNet](http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18.tar.gz)
187- DeepSpeech v1 converted from [TensorFlow model](https://github.com/mozilla/DeepSpeech/releases/tag/v0.4.1)
188- DeepSpeaker
James Ward590f3f72020-12-02 10:20:48 +0000189- [DeepLab v3+](https://www.tensorflow.org/lite/models/segmentation/overview)
190- FSRCNN
191- EfficientNet-lite
192- RDN converted from [TensorFlow model](https://github.com/hengchuan/RDN-TensorFlow)
193- Quantized RDN (CpuRef)
194- [Quantized Inception v3](http://download.tensorflow.org/models/tflite_11_05_08/inception_v3_quant.tgz)
195- [Quantized Inception v4](http://download.tensorflow.org/models/inception_v4_299_quant_20181026.tgz) (CpuRef)
196- Quantized ResNet v2 50 (CpuRef)
197- Quantized Yolo v3 (CpuRef)
Ryan OSheaf3a43232020-02-12 16:15:27 +0000198
199More machine learning operators will be supported in future releases.
Ryan OSheaf3a43232020-02-12 16:15:27 +0000200
201**/
202}
Ryan OShea2bbfaa72020-02-12 16:15:27 +0000203