blob: af87eba7af30ba65526a20f1046d1e319d70fdba [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
Ryan OSheaf3a43232020-02-12 16:15:27 +000025@section S5_onnx_parser ArmNN Onnx Parser
26
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
Ryan OSheaf3a43232020-02-12 16:15:27 +000052- GlobalAveragePool
53 - 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 +010054
55- LeakyRelu
56 - See the ONNX [LeakyRelu documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LeakyRelu) for more information.
57
Ryan OSheaf3a43232020-02-12 16:15:27 +000058- MaxPool
59 - 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 +010060
Ryan OSheaf3a43232020-02-12 16:15:27 +000061- Relu
62 - 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 +010063
Ryan OSheaf3a43232020-02-12 16:15:27 +000064- Reshape
65 - See the ONNX [Reshape documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Reshape) for more information.
66
Ryan OSheab23b9992020-04-23 15:45:04 +010067- Sigmoid
68 - See the ONNX [Sigmoid documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sigmoid) for more information.
69
70- Tanh
71 - See the ONNX [Tanh documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Tanh) for more information.
72
73
Jan Eilers53ca2e52021-02-02 13:18:09 +000074### Partially supported
Ryan OSheaf3a43232020-02-12 16:15:27 +000075
76- Conv
Jan Eilers1121c6b2021-02-19 09:38:03 +000077 - The parser only supports 2D convolutions with a group = 1 or group = #Nb_of_channel (depthwise convolution)
Ryan OSheaf3a43232020-02-12 16:15:27 +000078- BatchNormalization
79 - 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.
80- MatMul
81 - The parser only supports constant weights in a fully connected layer.
82
83## Tested networks
84
85Arm tested these operators with the following ONNX fp32 neural networks:
Jan Eilers53ca2e52021-02-02 13:18:09 +000086- Mobilenet_v2. See the ONNX [MobileNet documentation](https://github.com/onnx/models/tree/master/vision/classification/mobilenet) for more information.
87- 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 +000088
89More machine learning operators will be supported in future releases.
90<br/><br/><br/><br/>
91
Jan Eilers53ca2e52021-02-02 13:18:09 +000092
93
94
Ryan OSheaf3a43232020-02-12 16:15:27 +000095@section S6_tf_lite_parser ArmNN Tf Lite Parser
96
97`armnnTfLiteParser` is a library for loading neural networks defined by TensorFlow Lite FlatBuffers files
98into the Arm NN runtime.
99
100## TensorFlow Lite operators that the Arm NN SDK supports
101
102This reference guide provides a list of TensorFlow Lite operators the Arm NN SDK currently supports.
103
Jan Eilers53ca2e52021-02-02 13:18:09 +0000104### Fully supported
Ryan OSheaf3a43232020-02-12 16:15:27 +0000105The Arm NN SDK TensorFlow Lite parser currently supports the following operators:
106
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100107- ABS
Ryan OSheaf3a43232020-02-12 16:15:27 +0000108- ADD
Matthew Sloyan28f177c2021-04-09 14:38:52 +0100109- ARG_MAX
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100110- ARG_MIN
Ryan OSheaf3a43232020-02-12 16:15:27 +0000111- AVERAGE_POOL_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
112- BATCH_TO_SPACE
113- CONCATENATION, Supported Fused Activation: RELU , RELU6 , TANH, NONE
114- CONV_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
Jan Eilers53ca2e52021-02-02 13:18:09 +0000115- DEPTH_TO_SPACE
Ryan OSheaf3a43232020-02-12 16:15:27 +0000116- DEPTHWISE_CONV_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
James Ward590f3f72020-12-02 10:20:48 +0000117- DEQUANTIZE
Darshan Patel42b3d7d2020-05-25 22:30:07 +0530118- DIV
Jan Eilers53ca2e52021-02-02 13:18:09 +0000119- ELU
Ryan OSheaeb1f9cf2020-05-21 17:07:40 +0100120- EXP
Ryan OSheaf3a43232020-02-12 16:15:27 +0000121- FULLY_CONNECTED, Supported Fused Activation: RELU , RELU6 , TANH, NONE
Jan Eilers53ca2e52021-02-02 13:18:09 +0000122- GATHER
123- HARD_SWISH
124- LEAKY_RELU
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100125- LOGICAL_NOT
Ryan OSheaf3a43232020-02-12 16:15:27 +0000126- LOGISTIC
127- L2_NORMALIZATION
128- MAX_POOL_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
129- MAXIMUM
130- MEAN
131- MINIMUM
Jan Eilers1121c6b2021-02-19 09:38:03 +0000132- MUL
Darshan Patel83fcf982020-05-26 22:22:42 +0530133- NEG
Ryan OSheaf3a43232020-02-12 16:15:27 +0000134- PACK
135- PAD
James Ward590f3f72020-12-02 10:20:48 +0000136- QUANTIZE
Ryan OSheaf3a43232020-02-12 16:15:27 +0000137- RELU
138- RELU6
Jan Eilers1121c6b2021-02-19 09:38:03 +0000139- REDUCE_MAX
140- REDUCE_MIN
Ryan OSheaf3a43232020-02-12 16:15:27 +0000141- RESHAPE
142- RESIZE_BILINEAR
James Ward590f3f72020-12-02 10:20:48 +0000143- RESIZE_NEAREST_NEIGHBOR
Matthew Sloyaned7fce42021-04-15 20:46:24 +0100144- RSQRT
Ryan OSheaf3a43232020-02-12 16:15:27 +0000145- SLICE
146- SOFTMAX
147- SPACE_TO_BATCH
148- SPLIT
Ryan OShea86704732020-05-26 11:41:04 +0100149- SPLIT_V
Ryan OSheaf3a43232020-02-12 16:15:27 +0000150- SQUEEZE
151- STRIDED_SLICE
152- SUB
Jan Eilers1121c6b2021-02-19 09:38:03 +0000153- SUM
Ryan OSheaf3a43232020-02-12 16:15:27 +0000154- TANH
155- TRANSPOSE
156- TRANSPOSE_CONV
157- UNPACK
158
Jan Eilers53ca2e52021-02-02 13:18:09 +0000159### Custom Operator
Ryan OSheaf3a43232020-02-12 16:15:27 +0000160- TFLite_Detection_PostProcess
161
162## Tested networks
Ryan OSheaf3a43232020-02-12 16:15:27 +0000163Arm tested these operators with the following TensorFlow Lite neural network:
164- [Quantized MobileNet](http://download.tensorflow.org/models/mobilenet_v1_2018_02_22/mobilenet_v1_1.0_224_quant.tgz)
165- [Quantized SSD MobileNet](http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18.tar.gz)
166- DeepSpeech v1 converted from [TensorFlow model](https://github.com/mozilla/DeepSpeech/releases/tag/v0.4.1)
167- DeepSpeaker
James Ward590f3f72020-12-02 10:20:48 +0000168- [DeepLab v3+](https://www.tensorflow.org/lite/models/segmentation/overview)
169- FSRCNN
170- EfficientNet-lite
171- RDN converted from [TensorFlow model](https://github.com/hengchuan/RDN-TensorFlow)
172- Quantized RDN (CpuRef)
173- [Quantized Inception v3](http://download.tensorflow.org/models/tflite_11_05_08/inception_v3_quant.tgz)
174- [Quantized Inception v4](http://download.tensorflow.org/models/inception_v4_299_quant_20181026.tgz) (CpuRef)
175- Quantized ResNet v2 50 (CpuRef)
176- Quantized Yolo v3 (CpuRef)
Ryan OSheaf3a43232020-02-12 16:15:27 +0000177
178More machine learning operators will be supported in future releases.
Ryan OSheaf3a43232020-02-12 16:15:27 +0000179
180**/
181}
Ryan OShea2bbfaa72020-02-12 16:15:27 +0000182