aboutsummaryrefslogtreecommitdiff
path: root/SUPPORTED_OPS.md
diff options
context:
space:
mode:
authorJonas Ohlsson <jonas.ohlsson@arm.com>2021-07-26 16:13:12 +0200
committerJonas Ohlsson <jonas.ohlsson@arm.com>2021-07-27 11:06:27 +0200
commit45e653dbd81633b8d78215b16a9b2205e39dd8e2 (patch)
tree18b3073eac45e9e8d69a616ae96d7a3fbdef9663 /SUPPORTED_OPS.md
parentc2449827ec55f49b6087e3e385fb3c4f6776dc6a (diff)
downloadethos-u-vela-45e653dbd81633b8d78215b16a9b2205e39dd8e2.tar.gz
MLBEDSW-4853: Refactor supported operators
Refactor supported operators by breaking out model semantics into its own class. Model semantics checked right after model read. Signed-off-by: Jonas Ohlsson <jonas.ohlsson@arm.com> Change-Id: If442b189efcd91dda01af60b2b3adedfacdf2fad
Diffstat (limited to 'SUPPORTED_OPS.md')
-rw-r--r--SUPPORTED_OPS.md209
1 files changed, 130 insertions, 79 deletions
diff --git a/SUPPORTED_OPS.md b/SUPPORTED_OPS.md
index 013cad27..0e2076c1 100644
--- a/SUPPORTED_OPS.md
+++ b/SUPPORTED_OPS.md
@@ -1,54 +1,58 @@
# Supported Ops
This file was automatically generated by Vela using the `--supported-ops-report` parameter.
-Vela version: `2.1.2.dev0+g41c006a.d20210309`
+Vela version: `3.0.1.dev13+g004cefe`
This file complies with
[**Gitiles Markdown syntax**](https://github.com/google/gitiles/blob/master/Documentation/markdown.md)
-## Summary Table
+Summary table of constraints for:
+- [TFLite](#tflite-summary-table)
+- [TOSA](#tosa-summary-table)
+
+## TFLite Summary Table
The table below contains TFLite operators that can be placed on the Ethos-U NPU.
If the constraints are not met, then that operator will be scheduled on the CPU instead.
For any other TFLite operator not listed, will be left untouched and scheduled on the CPU.
Please check the supported operator list for your chosen runtime for further information.
-| Operator | Constraints |
+| Operator | TFLite Constraints |
| --- | --- |
-| ABS | [Generic](#generic-constraints), [Specific](#abs-constraints) |
-| ADD | [Generic](#generic-constraints), [Specific](#add-constraints) |
-| AVERAGE_POOL_2D | [Generic](#generic-constraints), [Specific](#average_pool_2d-constraints) |
-| CONCATENATION | [Generic](#generic-constraints), [Specific](#concatenation-constraints) |
-| CONV_2D | [Generic](#generic-constraints), [Specific](#conv_2d-constraints) |
-| DEPTHWISE_CONV_2D | [Generic](#generic-constraints), [Specific](#depthwise_conv_2d-constraints) |
-| FULLY_CONNECTED | [Generic](#generic-constraints), [Specific](#fully_connected-constraints) |
-| HARD_SWISH | [Generic](#generic-constraints), [Specific](#hard_swish-constraints) |
-| LEAKY_RELU | [Generic](#generic-constraints), [Specific](#leaky_relu-constraints) |
-| LOGISTIC | [Generic](#generic-constraints) |
-| MAXIMUM | [Generic](#generic-constraints), [Specific](#maximum-constraints) |
-| MAX_POOL_2D | [Generic](#generic-constraints), [Specific](#max_pool_2d-constraints) |
-| MEAN | [Generic](#generic-constraints), [Specific](#mean-constraints) |
-| MINIMUM | [Generic](#generic-constraints), [Specific](#minimum-constraints) |
-| MUL | [Generic](#generic-constraints), [Specific](#mul-constraints) |
-| PACK | [Generic](#generic-constraints) |
-| PAD | [Generic](#generic-constraints), [Specific](#pad-constraints) |
-| QUANTIZE | [Generic](#generic-constraints) |
-| RELU | [Generic](#generic-constraints) |
-| RELU6 | [Generic](#generic-constraints) |
-| RELU_N1_TO_1 | [Generic](#generic-constraints) |
-| RESHAPE | [Generic](#generic-constraints) |
-| RESIZE_BILINEAR | [Generic](#generic-constraints), [Specific](#resize_bilinear-constraints) |
-| SLICE | [Generic](#generic-constraints) |
-| SOFTMAX | [Generic](#generic-constraints), [Specific](#softmax-constraints) |
-| SPLIT | [Generic](#generic-constraints) |
-| SPLIT_V | [Generic](#generic-constraints), [Specific](#split_v-constraints) |
-| STRIDED_SLICE | [Generic](#generic-constraints), [Specific](#strided_slice-constraints) |
-| SUB | [Generic](#generic-constraints), [Specific](#sub-constraints) |
-| TANH | [Generic](#generic-constraints) |
-| TRANSPOSE_CONV | [Generic](#generic-constraints), [Specific](#transpose_conv-constraints) |
-| UNPACK | [Generic](#generic-constraints) |
-
-## Generic Constraints
+| ABS | [Generic](#tflite-generic-constraints), [Specific](#tflite-abs-constraints) |
+| ADD | [Generic](#tflite-generic-constraints), [Specific](#tflite-add-constraints) |
+| AVERAGE_POOL_2D | [Generic](#tflite-generic-constraints), [Specific](#tflite-average_pool_2d-constraints) |
+| CONCATENATION | [Generic](#tflite-generic-constraints), [Specific](#tflite-concatenation-constraints) |
+| CONV_2D | [Generic](#tflite-generic-constraints), [Specific](#tflite-conv_2d-constraints) |
+| DEPTHWISE_CONV_2D | [Generic](#tflite-generic-constraints), [Specific](#tflite-depthwise_conv_2d-constraints) |
+| FULLY_CONNECTED | [Generic](#tflite-generic-constraints), [Specific](#tflite-fully_connected-constraints) |
+| HARD_SWISH | [Generic](#tflite-generic-constraints), [Specific](#tflite-hard_swish-constraints) |
+| LEAKY_RELU | [Generic](#tflite-generic-constraints), [Specific](#tflite-leaky_relu-constraints) |
+| LOGISTIC | [Generic](#tflite-generic-constraints) |
+| MAXIMUM | [Generic](#tflite-generic-constraints), [Specific](#tflite-maximum-constraints) |
+| MAX_POOL_2D | [Generic](#tflite-generic-constraints), [Specific](#tflite-max_pool_2d-constraints) |
+| MEAN | [Generic](#tflite-generic-constraints), [Specific](#tflite-mean-constraints) |
+| MINIMUM | [Generic](#tflite-generic-constraints), [Specific](#tflite-minimum-constraints) |
+| MUL | [Generic](#tflite-generic-constraints), [Specific](#tflite-mul-constraints) |
+| PACK | [Generic](#tflite-generic-constraints) |
+| PAD | [Generic](#tflite-generic-constraints), [Specific](#tflite-pad-constraints) |
+| QUANTIZE | [Generic](#tflite-generic-constraints) |
+| RELU | [Generic](#tflite-generic-constraints) |
+| RELU6 | [Generic](#tflite-generic-constraints) |
+| RELU_N1_TO_1 | [Generic](#tflite-generic-constraints) |
+| RESHAPE | [Generic](#tflite-generic-constraints) |
+| RESIZE_BILINEAR | [Generic](#tflite-generic-constraints), [Specific](#tflite-resize_bilinear-constraints) |
+| SLICE | [Generic](#tflite-generic-constraints) |
+| SOFTMAX | [Generic](#tflite-generic-constraints), [Specific](#tflite-softmax-constraints) |
+| SPLIT | [Generic](#tflite-generic-constraints) |
+| SPLIT_V | [Generic](#tflite-generic-constraints), [Specific](#tflite-split_v-constraints) |
+| STRIDED_SLICE | [Generic](#tflite-generic-constraints), [Specific](#tflite-strided_slice-constraints) |
+| SUB | [Generic](#tflite-generic-constraints), [Specific](#tflite-sub-constraints) |
+| TANH | [Generic](#tflite-generic-constraints) |
+| TRANSPOSE_CONV | [Generic](#tflite-generic-constraints), [Specific](#tflite-transpose_conv-constraints) |
+| UNPACK | [Generic](#tflite-generic-constraints) |
+
+### TFLite Generic Constraints
This is a list of constraints that all NPU operators must satisfy in order to be scheduled on the NPU.
@@ -57,49 +61,49 @@ This is a list of constraints that all NPU operators must satisfy in order to be
- Output tensors cannot be scalar
- Scalar Input tensors are only valid for op type: ADD, MAXIMUM, MEAN, MINIMUM, MUL, SPLIT, SPLIT_V, SUB
- Input(s) and Output tensors must not be greater than 4D
+- Input(s), Output and Weight tensors must have quantization parameters
+- Input(s), Output and Weight tensors with quantization scales must be finite
+- Input and Output tensors must have quantization scales that fit within float32 precision
- Tensors must be of type: int16, int32, int8, uint8
- Tensors which are int32 are only valid when op type is: ADD, MUL, SUB
- Tensor dimensions must be in the range [1, 65535]
-- Input(s), Output and Weight tensors must have quantization parameters
-- Input(s), Output and Weight tensors with quantization scales must be finite
- Per-axis quantization is only supported for the following op types: CONV_2D, DEPTHWISE_CONV_2D, TRANSPOSE_CONV
- The fused activation function (if present) must be one of type: LOGISTIC, RELU, RELU6, RELU_N1_TO_1, TANH
- If a fused activation function is present, the Output tensor must be one of type: int16, int8, uint8
-- Input and Output tensors must have quantization scales that fit within float32 precision
-## ABS Constraints
+### TFLite ABS Constraints
This is a list of constraints that the ABS operator must satisfy in order to be scheduled on the NPU.
-- Batch size must be 1 for Input tensors with more than 2 dimensions
- At least one Input's shape must match the OFM's shape
- IFM and OFM data types must match
+- Batch size must be 1 for Input tensors with more than 2 dimensions
-## ADD Constraints
+### TFLite ADD Constraints
This is a list of constraints that the ADD operator must satisfy in order to be scheduled on the NPU.
-- Batch size must be 1 for Input tensors with more than 2 dimensions
- At least one Input's shape must match the OFM's shape
- Both Input data types must match
- For IFM that are signed, OFM must also be signed
- For IFM that are unsigned, OFM must either be the same type or int32
+- Batch size must be 1 for Input tensors with more than 2 dimensions
- Broadcasting is only allowed for rank indices with dimension 1, from either IFM1 or IFM2
-## AVERAGE_POOL_2D Constraints
+### TFLite AVERAGE_POOL_2D Constraints
This is a list of constraints that the AVERAGE_POOL_2D operator must satisfy in order to be scheduled on the NPU.
-- IFM Tensor batch size must be 1
- Stride values for both width and height must be integer types
-- Stride values for both width and height must be in the range [1, 3]
- IFM and OFM data types must match
- Kernel filter values for both width and height must be integer types
+- IFM Tensor batch size must be 1
+- Stride values for both width and height must be in the range [1, 3]
- Kernel filter values for both width and height must be in the range [1, 8]
- VALID padding: Kernel filter height must be in the range [1, 256]
- VALID padding: Product of kernel filter width and height must be in the range [1, 65536]
-## CONCATENATION Constraints
+### TFLite CONCATENATION Constraints
This is a list of constraints that the CONCATENATION operator must satisfy in order to be scheduled on the NPU.
@@ -108,13 +112,13 @@ This is a list of constraints that the CONCATENATION operator must satisfy in or
- All Input dimensionalities must match OFM dimensionality
- All Input dimensions must match OFM dimension in all axes except the one defined by the axis attribute
-## CONV_2D Constraints
+### TFLite CONV_2D Constraints
This is a list of constraints that the CONV_2D operator must satisfy in order to be scheduled on the NPU.
- Stride values for both width and height must be integer types
-- Stride values for both width and height must be in the range [1, 3]
- Dilation factor values for both width and height must be integer types
+- Stride values for both width and height must be in the range [1, 3]
- Dilation factor values for both width and height must be in the range [1, 2]
- Dilated kernel height must be in the range [1, 64]
- Product of dilated kernel width and height must be in the range [1, 4096]
@@ -125,13 +129,13 @@ This is a list of constraints that the CONV_2D operator must satisfy in order to
- Optional Bias tensor values must fit within 40-bits
- IFM Tensor batch size must be 1
-## DEPTHWISE_CONV_2D Constraints
+### TFLite DEPTHWISE_CONV_2D Constraints
This is a list of constraints that the DEPTHWISE_CONV_2D operator must satisfy in order to be scheduled on the NPU.
- Stride values for both width and height must be integer types
-- Stride values for both width and height must be in the range [1, 3]
- Dilation factor values for both width and height must be integer types
+- Stride values for both width and height must be in the range [1, 3]
- Dilation factor values for both width and height must be in the range [1, 2]
- Dilated kernel height must be in the range [1, 64]
- Product of dilated kernel width and height must be in the range [1, 4096]
@@ -143,56 +147,56 @@ This is a list of constraints that the DEPTHWISE_CONV_2D operator must satisfy i
- IFM Tensor batch size must be 1
- For depth multipliers > 1, IFM channels must be 1 and OFM channels must be equal to the depth multiplier
-## FULLY_CONNECTED Constraints
+### TFLite FULLY_CONNECTED Constraints
This is a list of constraints that the FULLY_CONNECTED operator must satisfy in order to be scheduled on the NPU.
+- The output tensor(s) must have 2D shape
+- The IFM and OFM must have the same number of dimensions if keep_num_dims is set to true
- Weight tensor must be 8-bit
- Weight tensor must be constant
- Optional Bias tensor must be of type: int32, int64
- Optional Bias tensor values must fit within 40-bits
-- The output tensor(s) must have 2D shape
-- The IFM and OFM must have the same number of dimensions if keep_num_dims is set to true
-## HARD_SWISH Constraints
+### TFLite HARD_SWISH Constraints
This is a list of constraints that the HARD_SWISH operator must satisfy in order to be scheduled on the NPU.
- IFM must be int8 or uint8
- IFM and OFM data types must match
-## LEAKY_RELU Constraints
+### TFLite LEAKY_RELU Constraints
This is a list of constraints that the LEAKY_RELU operator must satisfy in order to be scheduled on the NPU.
-- Batch size must be 1 for Input tensors with more than 2 dimensions
- At least one Input's shape must match the OFM's shape
- IFM and OFM data types must match
- Alpha must not be negative
+- Batch size must be 1 for Input tensors with more than 2 dimensions
-## MAXIMUM Constraints
+### TFLite MAXIMUM Constraints
This is a list of constraints that the MAXIMUM operator must satisfy in order to be scheduled on the NPU.
-- Batch size must be 1 for Input tensors with more than 2 dimensions
- At least one Input's shape must match the OFM's shape
- IFM and OFM data types must match
+- Batch size must be 1 for Input tensors with more than 2 dimensions
- Both Input quantization parameters must match OFM quantization parameters
- Broadcasting is only allowed for rank indices with dimension 1, from either IFM1 or IFM2
-## MAX_POOL_2D Constraints
+### TFLite MAX_POOL_2D Constraints
This is a list of constraints that the MAX_POOL_2D operator must satisfy in order to be scheduled on the NPU.
-- IFM Tensor batch size must be 1
- Stride values for both width and height must be integer types
-- Stride values for both width and height must be in the range [1, 3]
- IFM and OFM data types must match
- Kernel filter values for both width and height must be integer types
+- IFM Tensor batch size must be 1
+- Stride values for both width and height must be in the range [1, 3]
- Kernel filter height must be in the range [1, 256]
- Product of kernel filter width and height must be in the range [1, 65536]
-## MEAN Constraints
+### TFLite MEAN Constraints
This is a list of constraints that the MEAN operator must satisfy in order to be scheduled on the NPU.
@@ -208,38 +212,38 @@ This is a list of constraints that the MEAN operator must satisfy in order to be
keep_dims is set to True and
IFM datatype is int8
-## MINIMUM Constraints
+### TFLite MINIMUM Constraints
This is a list of constraints that the MINIMUM operator must satisfy in order to be scheduled on the NPU.
-- Batch size must be 1 for Input tensors with more than 2 dimensions
- At least one Input's shape must match the OFM's shape
- IFM and OFM data types must match
+- Batch size must be 1 for Input tensors with more than 2 dimensions
- Both Input quantization parameters must match OFM quantization parameters
- Broadcasting is only allowed for rank indices with dimension 1, from either IFM1 or IFM2
-## MUL Constraints
+### TFLite MUL Constraints
This is a list of constraints that the MUL operator must satisfy in order to be scheduled on the NPU.
-- Batch size must be 1 for Input tensors with more than 2 dimensions
- At least one Input's shape must match the OFM's shape
- Both Input data types must match
- For IFM that are signed, OFM must also be signed
- For IFM that are unsigned, OFM must either be the same type or int32
+- Batch size must be 1 for Input tensors with more than 2 dimensions
- Broadcasting is only allowed for rank indices with dimension 1, from either IFM1 or IFM2
-## PAD Constraints
+### TFLite PAD Constraints
This is a list of constraints that the PAD operator must satisfy in order to be scheduled on the NPU.
- Number of input tensors must be exactly 2
+- The padding tensor must be constant
- The padding tensor must have the shape [3,2] or [4,2]
- The pad tensor can only pad width and height
- Pad tensor must be of type: int32, int64
-- The padding tensor must be constant
-## RESIZE_BILINEAR Constraints
+### TFLite RESIZE_BILINEAR Constraints
This is a list of constraints that the RESIZE_BILINEAR operator must satisfy in order to be scheduled on the NPU.
@@ -249,7 +253,7 @@ This is a list of constraints that the RESIZE_BILINEAR operator must satisfy in
OFM W and H must be 2x IFM -1, if align_corners is True
OFM W and H must be 2x IFM, if align_corners is False
-## SOFTMAX Constraints
+### TFLite SOFTMAX Constraints
This is a list of constraints that the SOFTMAX operator must satisfy in order to be scheduled on the NPU.
@@ -257,41 +261,41 @@ This is a list of constraints that the SOFTMAX operator must satisfy in order to
- IFM and OFM data types must match
- Beta value needs to be positive
-## SPLIT_V Constraints
+### TFLite SPLIT_V Constraints
This is a list of constraints that the SPLIT_V operator must satisfy in order to be scheduled on the NPU.
- Only one size is allowed to be inferred
-## STRIDED_SLICE Constraints
+### TFLite STRIDED_SLICE Constraints
This is a list of constraints that the STRIDED_SLICE operator must satisfy in order to be scheduled on the NPU.
- Exactly 4 Input tensors are required
- Begin, End and Stride Input tensors must be constant
-- All Strides values must be 1
- ellipsis_mask must be 0
- new_axis_mask and shrink_axis_mask cannot both be set
- Slice 'end' values must be greater than 'begin' values
+- All Strides values must be 1
-## SUB Constraints
+### TFLite SUB Constraints
This is a list of constraints that the SUB operator must satisfy in order to be scheduled on the NPU.
-- Batch size must be 1 for Input tensors with more than 2 dimensions
- At least one Input's shape must match the OFM's shape
- Both Input data types must match
- For IFM that are signed, OFM must also be signed
- For IFM that are unsigned, OFM must either be the same type or int32
+- Batch size must be 1 for Input tensors with more than 2 dimensions
- Broadcasting is only allowed for rank indices with dimension 1, from either IFM1 or IFM2
-## TRANSPOSE_CONV Constraints
+### TFLite TRANSPOSE_CONV Constraints
This is a list of constraints that the TRANSPOSE_CONV operator must satisfy in order to be scheduled on the NPU.
- Stride values for both width and height must be integer types
-- Stride values for both width and height must be in the range [1, 3]
- Dilation factor values for both width and height must be integer types
+- Stride values for both width and height must be in the range [1, 3]
- Dilation factor values for both width and height must be in the range [1, 2]
- Dilated kernel height must be in the range [1, 64]
- Product of dilated kernel width and height must be in the range [1, 4096]
@@ -305,3 +309,50 @@ This is a list of constraints that the TRANSPOSE_CONV operator must satisfy in o
- SAME padding: OFM dimensions must equal IFM dimensions multiplied by stride
- VALID padding: OFM dimensions must equal IFM dimensions multiplied by stride,
minus difference between kernel size and stride
+
+## TOSA Summary Table
+
+The table below contains TOSA operators that can be placed on the Ethos-U NPU.
+Note: There is limited support for compiling a TOSA neural network (EXPERIMENTAL).
+The related constraints have not yet been populated in the list.
+
+| Operator | TOSA Constraints |
+| --- | --- |
+| ABS | [Generic](#tosa-generic-constraints) |
+| ADD | [Generic](#tosa-generic-constraints) |
+| AVERAGE_POOL_2D | [Generic](#tosa-generic-constraints) |
+| CONCATENATION | [Generic](#tosa-generic-constraints) |
+| CONV_2D | [Generic](#tosa-generic-constraints) |
+| DEPTHWISE_CONV_2D | [Generic](#tosa-generic-constraints) |
+| FULLY_CONNECTED | [Generic](#tosa-generic-constraints) |
+| HARD_SWISH | [Generic](#tosa-generic-constraints) |
+| LEAKY_RELU | [Generic](#tosa-generic-constraints) |
+| LOGISTIC | [Generic](#tosa-generic-constraints) |
+| MAXIMUM | [Generic](#tosa-generic-constraints) |
+| MAX_POOL_2D | [Generic](#tosa-generic-constraints) |
+| MEAN | [Generic](#tosa-generic-constraints) |
+| MINIMUM | [Generic](#tosa-generic-constraints) |
+| MUL | [Generic](#tosa-generic-constraints) |
+| PACK | [Generic](#tosa-generic-constraints) |
+| PAD | [Generic](#tosa-generic-constraints) |
+| QUANTIZE | [Generic](#tosa-generic-constraints) |
+| RELU | [Generic](#tosa-generic-constraints) |
+| RELU6 | [Generic](#tosa-generic-constraints) |
+| RELU_N1_TO_1 | [Generic](#tosa-generic-constraints) |
+| RESHAPE | [Generic](#tosa-generic-constraints) |
+| RESIZE_BILINEAR | [Generic](#tosa-generic-constraints) |
+| SLICE | [Generic](#tosa-generic-constraints) |
+| SOFTMAX | [Generic](#tosa-generic-constraints) |
+| SPLIT | [Generic](#tosa-generic-constraints) |
+| SPLIT_V | [Generic](#tosa-generic-constraints) |
+| STRIDED_SLICE | [Generic](#tosa-generic-constraints) |
+| SUB | [Generic](#tosa-generic-constraints) |
+| TANH | [Generic](#tosa-generic-constraints) |
+| TRANSPOSE_CONV | [Generic](#tosa-generic-constraints) |
+| UNPACK | [Generic](#tosa-generic-constraints) |
+
+### TOSA Generic Constraints
+
+This is a list of constraints that all NPU operators must satisfy in order to be scheduled on the NPU.
+
+- Tensors must be of type: int16, int32, int8, uint8