Narumol Prangnawarat | cb2ad74 | 2023-06-28 13:32:46 +0100 | [diff] [blame] | 1 | /// Copyright (c) 2022-2023 ARM Limited and Contributors. All rights reserved. |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 2 | /// |
| 3 | /// SPDX-License-Identifier: MIT |
| 4 | /// |
| 5 | |
| 6 | namespace armnn |
| 7 | { |
| 8 | /** |
| 9 | @page delegate TfLite Delegate |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 10 | |
| 11 | |
| 12 | @section delegateintro About the delegate |
| 13 | 'armnnDelegate' is a library for accelerating certain TensorFlow Lite (TfLite) operators on Arm hardware. It can be |
| 14 | integrated in TfLite using its delegation mechanism. TfLite will then delegate the execution of operators supported by |
| 15 | Arm NN to Arm NN. |
| 16 | |
| 17 | The main difference to our @ref S6_tf_lite_parser is the amount of operators you can run with it. If none of the active |
| 18 | backends support an operation in your model you won't be able to execute it with our parser. In contrast to that, TfLite |
| 19 | only delegates operations to the armnnDelegate if it does support them and otherwise executes them itself. In other |
| 20 | words, every TfLite model can be executed and every operation in your model that we can accelerate will be accelerated. |
| 21 | That is the reason why the armnnDelegate is our recommended way to accelerate TfLite models. |
| 22 | |
| 23 | If you need help building the armnnDelegate, please take a look at our [build guide](delegate/BuildGuideNative.md). |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 24 | |
| 25 | |
| 26 | @section delegatesupport Supported Operators |
| 27 | This reference guide provides a list of TensorFlow Lite operators the Arm NN SDK currently supports. |
| 28 | |
Nikhil Raj | c377eb8 | 2023-08-01 15:00:39 +0100 | [diff] [blame] | 29 | @section delegatefullysupported Fully supported |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 30 | |
| 31 | The Arm NN SDK TensorFlow Lite delegate currently supports the following operators: |
| 32 | |
| 33 | - ABS |
| 34 | |
| 35 | - ADD |
| 36 | |
Matthew Sloyan | ffa3493 | 2022-11-04 11:25:27 +0000 | [diff] [blame] | 37 | - ARG_MAX |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 38 | |
Matthew Sloyan | ffa3493 | 2022-11-04 11:25:27 +0000 | [diff] [blame] | 39 | - ARG_MIN |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 40 | |
Matthew Sloyan | ffa3493 | 2022-11-04 11:25:27 +0000 | [diff] [blame] | 41 | - AVERAGE_POOL_2D, Supported Fused Activation: RELU, RELU6, RELU_N1_TO_1, SIGMOID, TANH, NONE |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 42 | |
Matthew Sloyan | ffa3493 | 2022-11-04 11:25:27 +0000 | [diff] [blame] | 43 | - AVERAGE_POOL_3D, Supported Fused Activation: RELU, RELU6, RELU_N1_TO_1, SIGMOID, SIGN_BIT, TANH, NONE |
Ryan OShea | d21abaf | 2022-06-10 14:49:11 +0100 | [diff] [blame] | 44 | |
Ryan OShea | 49ed0df | 2022-09-21 16:09:41 +0100 | [diff] [blame] | 45 | - BATCH_MATMUL |
| 46 | |
Matthew Sloyan | a35b40b | 2021-02-05 17:22:28 +0000 | [diff] [blame] | 47 | - BATCH_TO_SPACE_ND |
| 48 | |
Sadik Armagan | 937565b | 2021-04-21 14:03:28 +0100 | [diff] [blame] | 49 | - CAST |
| 50 | |
Matthew Sloyan | f6ed6d4 | 2023-05-08 15:01:55 +0100 | [diff] [blame] | 51 | - CEIL |
| 52 | |
Matthew Sloyan | ffa3493 | 2022-11-04 11:25:27 +0000 | [diff] [blame] | 53 | - CONCATENATION, Supported Fused Activation: RELU, RELU6, RELU_N1_TO_1, SIGMOID, TANH, NONE |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 54 | |
Matthew Sloyan | ffa3493 | 2022-11-04 11:25:27 +0000 | [diff] [blame] | 55 | - CONV_2D, Supported Fused Activation: RELU, RELU6, RELU_N1_TO_1, SIGMOID, TANH, NONE |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 56 | |
Matthew Sloyan | ffa3493 | 2022-11-04 11:25:27 +0000 | [diff] [blame] | 57 | - CONV_3D, Supported Fused Activation: RELU, RELU6, RELU_N1_TO_1, SIGMOID, TANH, NONE |
Matthew Sloyan | 81ec994 | 2021-10-12 10:26:30 +0100 | [diff] [blame] | 58 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 59 | - DEPTH_TO_SPACE |
| 60 | |
Matthew Sloyan | ffa3493 | 2022-11-04 11:25:27 +0000 | [diff] [blame] | 61 | - DEPTHWISE_CONV_2D, Supported Fused Activation: RELU, RELU6, RELU_N1_TO_1, SIGMOID, TANH, NONE |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 62 | |
| 63 | - DEQUANTIZE |
| 64 | |
| 65 | - DIV |
| 66 | |
| 67 | - EQUAL |
| 68 | |
| 69 | - ELU |
| 70 | |
| 71 | - EXP |
| 72 | |
Matthew Sloyan | ffa3493 | 2022-11-04 11:25:27 +0000 | [diff] [blame] | 73 | - EXPAND_DIMS |
| 74 | |
| 75 | - FILL |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 76 | |
Sadik Armagan | 788e2c6 | 2021-02-10 16:26:44 +0000 | [diff] [blame] | 77 | - FLOOR |
| 78 | |
Matthew Sloyan | ffa3493 | 2022-11-04 11:25:27 +0000 | [diff] [blame] | 79 | - FLOOR_DIV |
| 80 | |
| 81 | - FULLY_CONNECTED, Supported Fused Activation: RELU, RELU6, RELU_N1_TO_1, SIGMOID, TANH, NONE |
| 82 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 83 | - GATHER |
| 84 | |
Teresa Charlin | d5c0ed2 | 2022-04-25 18:23:41 +0100 | [diff] [blame] | 85 | - GATHER_ND |
| 86 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 87 | - GREATER |
| 88 | |
Matthew Sloyan | ffa3493 | 2022-11-04 11:25:27 +0000 | [diff] [blame] | 89 | - GREATER_EQUAL |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 90 | |
| 91 | - HARD_SWISH |
| 92 | |
Matthew Sloyan | ffa3493 | 2022-11-04 11:25:27 +0000 | [diff] [blame] | 93 | - L2_NORMALIZATION |
| 94 | |
| 95 | - L2_POOL_2D |
| 96 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 97 | - LESS |
| 98 | |
Matthew Sloyan | ffa3493 | 2022-11-04 11:25:27 +0000 | [diff] [blame] | 99 | - LESS_EQUAL |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 100 | |
| 101 | - LOCAL_RESPONSE_NORMALIZATION |
| 102 | |
Teresa Charlin | b1f5f70 | 2022-07-12 14:16:24 +0100 | [diff] [blame] | 103 | - LOG |
| 104 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 105 | - LOGICAL_AND |
Jan Eilers | 1121c6b | 2021-02-19 09:38:03 +0000 | [diff] [blame] | 106 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 107 | - LOGICAL_NOT |
Jan Eilers | 1121c6b | 2021-02-19 09:38:03 +0000 | [diff] [blame] | 108 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 109 | - LOGICAL_OR |
| 110 | |
| 111 | - LOGISTIC |
| 112 | |
| 113 | - LOG_SOFTMAX |
| 114 | |
Jan Eilers | 1121c6b | 2021-02-19 09:38:03 +0000 | [diff] [blame] | 115 | - LSTM |
| 116 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 117 | - MAXIMUM |
| 118 | |
Matthew Sloyan | ffa3493 | 2022-11-04 11:25:27 +0000 | [diff] [blame] | 119 | - MAX_POOL_2D, Supported Fused Activation: RELU, RELU6, RELU_N1_TO_1, SIGMOID, TANH, NONE |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 120 | |
Matthew Sloyan | ffa3493 | 2022-11-04 11:25:27 +0000 | [diff] [blame] | 121 | - MAX_POOL_3D, Supported Fused Activation: RELU, RELU6, RELU_N1_TO_1, SIGMOID, SIGN_BIT, TANH, NONE |
Ryan OShea | d21abaf | 2022-06-10 14:49:11 +0100 | [diff] [blame] | 122 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 123 | - MEAN |
| 124 | |
| 125 | - MINIMUM |
| 126 | |
Matthew Sloyan | af3a4ef | 2021-10-22 15:48:12 +0100 | [diff] [blame] | 127 | - MIRROR_PAD |
| 128 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 129 | - MUL |
| 130 | |
| 131 | - NEG |
| 132 | |
| 133 | - NOT_EQUAL |
| 134 | |
Kevin May | c7bd7e8 | 2021-05-10 12:46:40 +0100 | [diff] [blame] | 135 | - PACK |
| 136 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 137 | - PAD |
| 138 | |
Matthew Sloyan | ffa3493 | 2022-11-04 11:25:27 +0000 | [diff] [blame] | 139 | - PADV2 |
| 140 | |
John Mcloughlin | 0ec0087 | 2023-05-15 17:03:49 +0100 | [diff] [blame] | 141 | - POW |
| 142 | |
Jan Eilers | 1121c6b | 2021-02-19 09:38:03 +0000 | [diff] [blame] | 143 | - PRELU |
| 144 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 145 | - QUANTIZE |
| 146 | |
Jan Eilers | 1121c6b | 2021-02-19 09:38:03 +0000 | [diff] [blame] | 147 | - RANK |
| 148 | |
| 149 | - REDUCE_MAX |
| 150 | |
| 151 | - REDUCE_MIN |
| 152 | |
Matthew Sloyan | ffa3493 | 2022-11-04 11:25:27 +0000 | [diff] [blame] | 153 | - REDUCE_PROD |
| 154 | |
| 155 | - RELU |
| 156 | |
| 157 | - RELU6 |
| 158 | |
| 159 | - RELU_N1_TO_1 |
| 160 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 161 | - RESHAPE |
| 162 | |
| 163 | - RESIZE_BILINEAR |
| 164 | |
| 165 | - RESIZE_NEAREST_NEIGHBOR |
| 166 | |
Tracy Narine | 7306bbe | 2023-07-17 16:06:26 +0100 | [diff] [blame] | 167 | - REVERSEV2 |
| 168 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 169 | - RSQRT |
| 170 | |
Matthew Sloyan | e369dbd | 2021-08-19 12:05:44 +0100 | [diff] [blame] | 171 | - SHAPE |
| 172 | |
Teresa Charlin | b1f5f70 | 2022-07-12 14:16:24 +0100 | [diff] [blame] | 173 | - SIN |
| 174 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 175 | - SOFTMAX |
| 176 | |
Matthew Sloyan | a35b40b | 2021-02-05 17:22:28 +0000 | [diff] [blame] | 177 | - SPACE_TO_BATCH_ND |
| 178 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 179 | - SPACE_TO_DEPTH |
| 180 | |
| 181 | - SPLIT |
| 182 | |
| 183 | - SPLIT_V |
| 184 | |
| 185 | - SQRT |
| 186 | |
John Mcloughlin | 0ec0087 | 2023-05-15 17:03:49 +0100 | [diff] [blame] | 187 | - SQUARE_DIFFERENCE |
| 188 | |
Matthew Sloyan | ffa3493 | 2022-11-04 11:25:27 +0000 | [diff] [blame] | 189 | - SQUEEZE |
| 190 | |
Matthew Sloyan | f6ed6d4 | 2023-05-08 15:01:55 +0100 | [diff] [blame] | 191 | - SLICE |
| 192 | |
Jan Eilers | 1121c6b | 2021-02-19 09:38:03 +0000 | [diff] [blame] | 193 | - STRIDED_SLICE |
| 194 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 195 | - SUB |
| 196 | |
Jan Eilers | 1121c6b | 2021-02-19 09:38:03 +0000 | [diff] [blame] | 197 | - SUM |
| 198 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 199 | - TANH |
| 200 | |
Tianle Cheng | 92ce35c | 2023-07-25 16:41:00 +0100 | [diff] [blame] | 201 | - TILE |
| 202 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 203 | - TRANSPOSE |
| 204 | |
| 205 | - TRANSPOSE_CONV |
| 206 | |
Narumol Prangnawarat | bd575b2 | 2021-08-31 16:53:54 +0100 | [diff] [blame] | 207 | - UNIDIRECTIONAL_SEQUENCE_LSTM |
| 208 | |
Kevin May | c7bd7e8 | 2021-05-10 12:46:40 +0100 | [diff] [blame] | 209 | - UNPACK |
| 210 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 211 | More machine learning operators will be supported in future releases. |
Colm Donelan | 0902693 | 2022-09-14 18:04:00 +0100 | [diff] [blame] | 212 | |
| 213 | @section delegateoptions Delegate Options |
| 214 | |
| 215 | The general list of runtime options are described in @subpage runtimeoptions |
| 216 | |
Narumol Prangnawarat | cb2ad74 | 2023-06-28 13:32:46 +0100 | [diff] [blame] | 217 | @subsection opaquedelegateoptions Opaque Delegate Options |
| 218 | |
| 219 | In Opaque Delegate, delegate options are passed via ArmNNSettings which is a FlatBuffer of tflite::TFLiteSettings. |
| 220 | |
| 221 | Arm NN Settings | Possible Values | Description |
| 222 | :--------------- ------------- | :----- | :---------- |
| 223 | backends | ["GpuAcc"/"CpuAcc"] | A comma separated list without whitespaces of backends which should be used for execution. Falls back to next backend in list if previous does not provide support for operation. |
| 224 | fastmath | [true/false] | Allows the use of optimisation techniques e.g. Winograd that will reduce execution time with the possibility of a drop in accuracy. |
| 225 | additional_parameters | JSON string of additional Arm NN delegate options | JSON string of additional Arm NN delegate options. The general list of runtime options are described in [Runtime options](\ref runtimeoptions). |
| 226 | |
Jan Eilers | 31a7c89 | 2021-01-29 14:18:13 +0000 | [diff] [blame] | 227 | **/ |
| 228 | } |