IVGCVSW-5695 Update supported operators
[platform/upstream/armnn.git] / docs / 01_01_parsers.dox
1 /// Copyright (c) 2021 ARM Limited and Contributors. All rights reserved.
2 ///
3 /// SPDX-License-Identifier: MIT
4 ///
5
6 namespace armnn
7 {
8 /**
9 @page parsers Parsers
10
11 @tableofcontents
12 Execute models from different machine learning platforms efficiently with our parsers. Simply choose a parser according
13 to the model you want to run e.g. If you've got a model in tensorflow format (<model_name>.pb) use our tensorflow-parser.
14
15 If you would like to run a Tensorflow Lite (TfLite) model you probably also want to take a look at our @ref delegate.
16
17 All parsers are written in C++ but it is also possible to use them in python. For more information on our python
18 bindings take a look into the @ref md_python_pyarmnn_README section.
19
20
21
22 @section S4_caffe_parser Arm NN Caffe Parser
23
24 `armnnCaffeParser` is a library for loading neural networks defined in Caffe protobuf files into the Arm NN runtime.
25
26 Please note that certain deprecated Caffe features are not supported by the armnnCaffeParser. If you think that Arm NN
27 should be able to load your model according to the list of supported layers, but you are getting strange error
28 messages, then try upgrading your model to the latest format using Caffe, either by saving it to a new file or using
29 the upgrade utilities in `caffe/tools`.
30
31 \b NOTE: The Arm NN Caffe Parser is deprecated in Arm NN 21.02 and will be removed in 21.05.
32
33 ## Caffe layers supported by the Arm NN SDK
34 This reference guide provides a list of Caffe layers the Arm NN SDK currently supports.
35
36 ### Although some other neural networks might work, Arm tests the Arm NN SDK with Caffe implementations of the following neural networks:
37
38 - AlexNet.
39 - Cifar10.
40 - Inception-BN.
41 - Resnet_50, Resnet_101 and Resnet_152.
42 - VGG_CNN_S, VGG_16 and VGG_19.
43 - Yolov1_tiny.
44 - Lenet.
45 - MobileNetv1.
46 - SqueezeNet v1.0 and SqueezeNet v1.1
47
48 ### The Arm NN SDK supports the following machine learning layers for Caffe networks:
49
50 - Argmax, excluding the top_k and out_max_val parameters.
51 - BatchNorm, in inference mode.
52 - Convolution, excluding Weight Filler, Bias Filler, Engine, Force nd_im2col, and Axis parameters.
53 - Deconvolution, excluding the Dilation Size, Weight Filler, Bias Filler, Engine, Force nd_im2col, and Axis parameters.
54
55   Caffe doesn't support depthwise convolution, the equivalent layer is implemented through the notion of groups. ArmNN supports groups this way:
56   - when group=1, it is a normal conv2d
57   - when group=#input_channels, we can replace it by a depthwise convolution
58   - when group>1 && group<#input_channels, we need to split the input into the given number of groups, apply a separate convolution and then merge the results
59 - Concat, along the channel dimension only.
60 - Dropout, in inference mode.
61 - Eltwise, excluding the coeff parameter.
62 - Inner Product, excluding the Weight Filler, Bias Filler, Engine, and Axis parameters.
63 - Input.
64 - LRN, excluding the Engine parameter.
65 - Pooling, excluding the Stochastic Pooling and Engine parameters.
66 - ReLU.
67 - Scale.
68 - Softmax, excluding the Axis and Engine parameters.
69 - Split.
70
71 More machine learning layers will be supported in future releases.
72
73 <br/><br/><br/><br/>
74
75
76
77
78 @section S5_onnx_parser ArmNN Onnx Parser
79
80 `armnnOnnxParser` is a library for loading neural networks defined in ONNX protobuf files into the Arm NN runtime.
81
82 ## ONNX operators that the Arm NN SDK supports
83
84 This reference guide provides a list of ONNX operators the Arm NN SDK currently supports.
85
86 The Arm NN SDK ONNX parser currently only supports fp32 operators.
87
88 ### Fully supported
89
90 - Add
91   - See the ONNX [Add documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Add) for more information
92
93 - AveragePool
94   - See the ONNX [AveragePool documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#AveragePool) for more information.
95
96 - Constant
97   - See the ONNX [Constant documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Constant) for more information.
98
99 - Clip
100   - See the ONNX [Clip documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Clip) for more information.
101
102 - Flatten
103   - See the ONNX [Flatten documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Flatten) for more information.
104
105 - GlobalAveragePool
106   - See the ONNX [GlobalAveragePool documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#GlobalAveragePool) for more information.
107
108 - LeakyRelu
109   - See the ONNX [LeakyRelu documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LeakyRelu) for more information.
110
111 - MaxPool
112   - See the ONNX [max_pool documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#MaxPool) for more information.
113
114 - Relu
115   - See the ONNX [Relu documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Relu) for more information.
116
117 - Reshape
118   - See the ONNX [Reshape documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Reshape) for more information.
119
120 - Sigmoid
121   - See the ONNX [Sigmoid documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sigmoid) for more information.
122
123 - Tanh
124   - See the ONNX [Tanh documentation](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Tanh) for more information.
125
126
127 ### Partially supported
128
129 - Conv
130   - The parser only supports 2D convolutions with a group = 1 or group = #Nb_of_channel (depthwise convolution)
131 - BatchNormalization
132   - 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.
133 - MatMul
134   - The parser only supports constant weights in a fully connected layer.
135
136 ## Tested networks
137
138 Arm tested these operators with the following ONNX fp32 neural networks:
139 - Mobilenet_v2. See the ONNX [MobileNet documentation](https://github.com/onnx/models/tree/master/vision/classification/mobilenet) for more information.
140 - 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).
141
142 More machine learning operators will be supported in future releases.
143 <br/><br/><br/><br/>
144
145
146
147
148 @section S6_tf_lite_parser ArmNN Tf Lite Parser
149
150 `armnnTfLiteParser` is a library for loading neural networks defined by TensorFlow Lite FlatBuffers files
151 into the Arm NN runtime.
152
153 ## TensorFlow Lite operators that the Arm NN SDK supports
154
155 This reference guide provides a list of TensorFlow Lite operators the Arm NN SDK currently supports.
156
157 ### Fully supported
158 The Arm NN SDK TensorFlow Lite parser currently supports the following operators:
159
160 - ADD
161 - AVERAGE_POOL_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
162 - BATCH_TO_SPACE
163 - CONCATENATION, Supported Fused Activation: RELU , RELU6 , TANH, NONE
164 - CONV_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
165 - DEPTH_TO_SPACE
166 - DEPTHWISE_CONV_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
167 - DEQUANTIZE
168 - DIV
169 - ELU
170 - EXP
171 - FULLY_CONNECTED, Supported Fused Activation: RELU , RELU6 , TANH, NONE
172 - GATHER
173 - HARD_SWISH
174 - LEAKY_RELU
175 - LOGISTIC
176 - L2_NORMALIZATION
177 - MAX_POOL_2D, Supported Fused Activation: RELU , RELU6 , TANH, NONE
178 - MAXIMUM
179 - MEAN
180 - MINIMUM
181 - MUL
182 - NEG
183 - PACK
184 - PAD
185 - QUANTIZE
186 - RELU
187 - RELU6
188 - REDUCE_MAX
189 - REDUCE_MIN
190 - RESHAPE
191 - RESIZE_BILINEAR
192 - RESIZE_NEAREST_NEIGHBOR
193 - SLICE
194 - SOFTMAX
195 - SPACE_TO_BATCH
196 - SPLIT
197 - SPLIT_V
198 - SQUEEZE
199 - STRIDED_SLICE
200 - SUB
201 - SUM
202 - TANH
203 - TRANSPOSE
204 - TRANSPOSE_CONV
205 - UNPACK
206
207 ### Custom Operator
208 - TFLite_Detection_PostProcess
209
210 ## Tested networks
211 Arm tested these operators with the following TensorFlow Lite neural network:
212 - [Quantized MobileNet](http://download.tensorflow.org/models/mobilenet_v1_2018_02_22/mobilenet_v1_1.0_224_quant.tgz)
213 - [Quantized SSD MobileNet](http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18.tar.gz)
214 - DeepSpeech v1 converted from [TensorFlow model](https://github.com/mozilla/DeepSpeech/releases/tag/v0.4.1)
215 - DeepSpeaker
216 - [DeepLab v3+](https://www.tensorflow.org/lite/models/segmentation/overview)
217 - FSRCNN
218 - EfficientNet-lite
219 - RDN converted from [TensorFlow model](https://github.com/hengchuan/RDN-TensorFlow)
220 - Quantized RDN (CpuRef)
221 - [Quantized Inception v3](http://download.tensorflow.org/models/tflite_11_05_08/inception_v3_quant.tgz)
222 - [Quantized Inception v4](http://download.tensorflow.org/models/inception_v4_299_quant_20181026.tgz) (CpuRef)
223 - Quantized ResNet v2 50 (CpuRef)
224 - Quantized Yolo v3 (CpuRef)
225
226 More machine learning operators will be supported in future releases.
227 <br/><br/><br/><br/>
228
229
230
231
232 @section S7_tf_parser ArmNN Tensorflow Parser
233
234 `armnnTfParser` is a library for loading neural networks defined by TensorFlow protobuf files into the Arm NN runtime.
235
236 \b NOTE: The Arm NN Tensorflow Parser is deprecated in Arm NN 21.02 and will be removed in 21.05.
237
238 ## TensorFlow operators that the Arm NN SDK supports
239
240 This reference guide provides a list of TensorFlow operators the Arm NN SDK currently supports.
241
242 The Arm NN SDK TensorFlow parser currently only supports fp32 operators.
243
244 ### Fully supported
245
246 - avg_pool
247   - See the TensorFlow [avg_pool documentation](https://www.tensorflow.org/api_docs/python/tf/nn/avg_pool) for more information.
248 - bias_add
249   - See the TensorFlow [bias_add documentation](https://www.tensorflow.org/api_docs/python/tf/nn/bias_add) for more information.
250 - conv2d
251   - See the TensorFlow [conv2d documentation](https://www.tensorflow.org/api_docs/python/tf/nn/conv2d) for more information.
252 - expand_dims
253   - See the TensorFlow [expand_dims documentation](https://www.tensorflow.org/api_docs/python/tf/expand_dims) for more information.
254 - gather
255   - See the TensorFlow [gather documentation](https://www.tensorflow.org/api_docs/python/tf/gather) for more information.
256 - identity
257   - See the TensorFlow [identity documentation](https://www.tensorflow.org/api_docs/python/tf/identity) for more information.
258 - local_response_normalization
259   - See the TensorFlow [local_response_normalization documentation](https://www.tensorflow.org/api_docs/python/tf/nn/local_response_normalization)  for more information.
260 - max_pool
261   - See the TensorFlow [max_pool documentation](https://www.tensorflow.org/api_docs/python/tf/nn/max_pool) for more information.
262 - placeholder
263   - See the TensorFlow [placeholder documentation](https://www.tensorflow.org/api_docs/python/tf/placeholder) for more information.
264 - reduce_mean
265   - See the TensorFlow [reduce_mean documentation](https://www.tensorflow.org/api_docs/python/tf/reduce_mean) for more information.
266 - relu
267   - See the TensorFlow [relu documentation](https://www.tensorflow.org/api_docs/python/tf/nn/relu) for more information.
268 - relu6
269   - See the TensorFlow [relu6 documentation](https://www.tensorflow.org/api_docs/python/tf/nn/relu6) for more information.
270 - rsqrt
271   - See the TensorFlow [rsqrt documentation](https://www.tensorflow.org/api_docs/python/tf/math/rsqrt) for more information.
272 - shape
273   - See the TensorFlow [shape documentation](https://www.tensorflow.org/api_docs/python/tf/shape) for more information.
274 - sigmoid
275   - See the TensorFlow [sigmoid documentation](https://www.tensorflow.org/api_docs/python/tf/sigmoid) for more information.
276 - softplus
277   - See the TensorFlow [softplus documentation](https://www.tensorflow.org/api_docs/python/tf/nn/softplus) for more information.
278 - squeeze
279   - See the TensorFlow [squeeze documentation](https://www.tensorflow.org/api_docs/python/tf/squeeze) for more information.
280 - tanh
281   - See the TensorFlow [tanh documentation](https://www.tensorflow.org/api_docs/python/tf/tanh) for more information.
282 - transpose
283   - See the TensorFlow [transpose documentation](https://www.tensorflow.org/api_docs/python/tf/transpose) for more information.
284
285 ### Partially supported
286
287 - add
288   - The parser does not support all forms of [broadcast composition](https://www.tensorflow.org/performance/xla/broadcasting), only broadcasting of scalars and 1D tensors. See the TensorFlow [add operator documentation](https://www.tensorflow.org/api_docs/python/tf/add) for more information.
289 - add_n
290   - The parser does not support all forms of [broadcast composition](https://www.tensorflow.org/performance/xla/broadcasting), only broadcasting of scalars and 1D tensors. See the TensorFlow [add operator documentation](https://www.tensorflow.org/api_docs/python/tf/add_n) for more information.
291 - concat
292   - Arm NN supports concatenation along the channel dimension for data formats NHWC and NCHW.
293 - constant
294   - The parser does not support the optional `shape` argument. It always infers the shape of the output tensor from `value`. See the TensorFlow [constant documentation](https://www.tensorflow.org/api_docs/python/tf/constant) for further information.
295 - depthwise_conv2d_native
296   - The parser only supports a dilation rate of (1,1,1,1). See the TensorFlow [depthwise_conv2d_native documentation](https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d_native) for more information.
297 - equal
298   - The parser does not support all forms of [broadcast composition](https://www.tensorflow.org/performance/xla/broadcasting), only broadcasting of 4D and 1D tensors. See the TensorFlow [equal operator documentation](https://www.tensorflow.org/api_docs/python/tf/math/equal) for more information.
299 - fused_batch_norm
300   - The parser does not support training outputs. See the TensorFlow [fused_batch_norm documentation](https://www.tensorflow.org/api_docs/python/tf/nn/fused_batch_norm) for more information.
301 - greater
302   - The parser does not support all forms of [broadcast composition](https://www.tensorflow.org/performance/xla/broadcasting), only broadcasting of 4D and 1D tensors. See the TensorFlow [greater operator documentation](https://www.tensorflow.org/api_docs/python/tf/math/greater) for more information.
303 - matmul
304   - The parser only supports constant weights in a fully connected layer. See the TensorFlow [matmul documentation](https://www.tensorflow.org/api_docs/python/tf/matmul) for more information.
305 - maximum
306   where maximum is used in one of the following ways
307   - max(mul(a, x), x)
308   - max(mul(x, a), x)
309   - max(x, mul(a, x))
310   - max(x, mul(x, a)
311   This is interpreted as a ActivationLayer with a LeakyRelu activation function. Any other usage of max will result in the insertion of a simple maximum layer. The parser does not support all forms of [broadcast composition](https://www.tensorflow.org/performance/xla/broadcasting). See the TensorFlow [maximum documentation](https://www.tensorflow.org/api_docs/python/tf/maximum) for more information.
312 - minimum
313   - The parser does not support all forms of [broadcast composition](https://www.tensorflow.org/performance/xla/broadcasting), only broadcasting of 4D and 1D tensors. See the TensorFlow [minimum operator documentation](https://www.tensorflow.org/api_docs/python/tf/math/minimum) for more information.
314 - multiply
315   - The parser does not support all forms of [broadcast composition](https://www.tensorflow.org/performance/xla/broadcasting), only broadcasting of scalars and 1D tensors. See the TensorFlow [multiply documentation](https://www.tensorflow.org/api_docs/python/tf/multiply) for more information.
316 - pack/stack
317   - See the TensorFlow [stack documentation](https://www.tensorflow.org/api_docs/python/tf/stack) for more information.
318 - pad
319   - Only supports tf.pad function with mode = 'CONSTANT' and constant_values = 0. See the TensorFlow [pad documentation](https://www.tensorflow.org/api_docs/python/tf/pad) for more information.
320 - realdiv
321   - The parser does not support all forms of [broadcast composition](https://www.tensorflow.org/performance/xla/broadcasting), only broadcasting of scalars and 1D tensors. See the TensorFlow [realdiv documentation](https://www.tensorflow.org/api_docs/python/tf/realdiv) for more information.
322 - reshape
323   - The parser does not support reshaping to or from 4D. See the TensorFlow [reshape documentation](https://www.tensorflow.org/api_docs/python/tf/reshape) for more information.
324 - resize_images
325   - The parser only supports `ResizeMethod.BILINEAR` with `align_corners=False`. See the TensorFlow [resize_images documentation](https://www.tensorflow.org/api_docs/python/tf/image/resize_images) for more information.
326 - softmax
327   - The parser only supports 2D inputs and does not support selecting the `softmax` dimension. See the TensorFlow [softmax documentation](https://www.tensorflow.org/api_docs/python/tf/nn/softmax) for more information.
328 - split
329   - Arm NN supports split along the channel dimension for data formats NHWC and NCHW.
330 - strided_slice
331   - See the TensorFlow [strided_slice documentation](https://www.tensorflow.org/api_docs/python/tf/strided_slice) for more information.
332 - subtract
333   - The parser does not support all forms of broadcasting [broadcast composition](https://www.tensorflow.org/performance/xla/broadcasting), only broadcasting of scalars and 1D tensors. See the TensorFlow [subtract documentation](https://www.tensorflow.org/api_docs/python/tf/math/subtract) for more information.
334
335
336 ## Tested networks
337
338 Arm tests these operators with the following TensorFlow fp32 neural networks:
339 - Lenet
340 - mobilenet_v1_1.0_224. The Arm NN SDK only supports the non-quantized version of the network. See the [MobileNet_v1 documentation](https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet_v1.md) for more information on quantized networks.
341 - inception_v3. The Arm NN SDK only supports the official inception_v3 transformed model. See the TensorFlow documentation on [preparing models for mobile deployment](https://www.tensorflow.org/mobile/prepare_models) for more information on how to transform the inception_v3 network.
342 - Simple MNIST. For more information check out the [tutorial](https://developer.arm.com/technologies/machine-learning-on-arm/developer-material/how-to-guides/deploying-a-tensorflow-mnist-model-on-arm-nn) on the Arm Developer portal.
343 - ResNet v2 50 implementation from the [TF Slim model zoo](https://github.com/tensorflow/models/tree/master/research/slim)
344
345 More machine learning operators will be supported in future releases.
346
347 **/
348 }
349