aboutsummaryrefslogtreecommitdiff
path: root/src/armnnTfLiteParser/TfLiteParser.cpp
AgeCommit message (Collapse)Author
2024-05-10MLCE-1276 Fix for ExecuteNetwork abort after inferenceKevin May
* The abort is caused during destruction of flatbuffers::ClassicLocale * Set FLATBUFFERS_LOCALE_INDEPENDENT=0 in delegates and parser so that ClassicLocale is not included Signed-off-by: Kevin May <kevin.may@arm.com> Change-Id: I34584b05998a62bae2263a2281414fcf8c12d668 Signed-off-by: Colm Donelan <colm.donelan@arm.com>
2024-03-12IVGCVSW-8231 ScatterNd added to TFLite parserTeresa Charlin
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: I5b87304319f5e83e8eba9cb2d934fc4a6aebe85b
2023-11-09IVGCVSW-7861 Updating tflite parser to ignore VALIDATION: subgraphs.Colm Donelan
Signed-off-by: Colm Donelan <colm.donelan@arm.com> Change-Id: If156b975d37868db77d7c6bb75d884652278e02a
2023-11-08IVGCVSW-8140 Prelu restriction in quantization not neededTeresa Charlin
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: Ic3c42db6fd87b379b42d610e0d0f56f55580268d
2023-10-20IVGCVSW-8103 SquareDiff restriction in quantization not neededTeresa Charlin
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: Ib49795e44ea7e4674a3b8e0df46e80c82f9a4132
2023-10-12Revert "Revert "MLCE-1093 Reshape and concat invalid results""Mike Kelly
This reverts commit 008270f8c1359a7d62c2f881326b4d3f0d8b7b56. Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: If8f5151aa349ff3834f03391e813669e5c51ed66
2023-10-03IVGCVSW-7749 DTS: Fix reshape floating point exceptionTianle Cheng
* Updated Opaque Delegate, TfliteParser, OnnxParser, and Deserializer to handle the Zero In Shape edge case Signed-off-by: Tianle Cheng <tianle.cheng@arm.com> Change-Id: I4a0d1e72a66de1fa56de99af9b6730a84e0ff596
2023-09-29IVGCVSW-8055 Add support for GELU activation function.Teresa Charlin
* Add support to CpuRef, CpuAcc and GpuAcc * Add support to tflite parser, classic and opaque tflite delegates * Add support to serializer and deserializer * Add Unit tests Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: Ibc60ef2ef2a051e6d9af6e15d24c46316ec19de4
2023-09-08IVGCVSW-7525 Add broadcast_to to TFLite ParserIdriss Chaouch
* Changing the optimizer * Changing EndToEnd Tests Signed-off-by: Idriss Chaouch <idriss.chaouch@arm.com> Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: Ib581794280322a39cfc5ea3c4e6a6398cf723d5e
2023-08-21IVGCVSW-7964 Fix UnidirectionalSequenceLstmNarumol Prangnawarat
* Fix incorrect batch size and time size * Fix incorrect time major when max time =1 * Fix incorrect permutation * Fix incorrect scratch buffer * Unit tests Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: I510fae55528be412a58d020e82bd283852e7800b
2023-08-11Revert "MLCE-1093 Reshape and concat invalid results"Nikhil Raj Arm
This reverts commit 4980e21193f0a14fef084a7f4b4197392f3c0845. Reason for revert: Android Build for v82a failed due to schema not re-generating Change-Id: Ic19cf471b487f321c97ff837d36526512fb12fa4
2023-08-10MLCE-1093 Reshape and concat invalid resultsMike Kelly
!android-nn-driver:10089 * Disabled SubTensors on CL and Neon Backends. * Added Axis to ViewsDescriptor to store the value where ever possible. * Updated Splitter tests to provide all the information needed in the Descriptor. * Updated Serializer and Deserializer to handle axis. Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: I6a22d4750e04003689495b5e9e3c33deb37162bd
2023-08-04IVGCVSW-7635 Remove deprecated code due to be removed in 23.08 (ILayerSupport)Francis Murtagh
* ILayerSupport interface - removed unstable virtual functions. * User instead uses IsLayerSupported accepting LayerType enum argument. * Backend developers should implement the ILayerSupport::IsLayerSupported method accepting LayerType as a switch statement with case being LayerType and each case calling their implementation of IsXXXSupported() Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Change-Id: Iaaead8320bb1b2f1bdab6b5be2e1e69d0eb482d5
2023-08-04IVGCVSW-7676 Audit the use of ARMNN_ASSERTRyan OShea
* Replace most ARMNN_ASSERT's from tflite parser * Replace most ARMNN_ASSERT's from onnx parser * Replace some ARMNN_ASSERT's from tflite delegate * Replace some ARMNN_ASSERT;s from include files Signed-off-by: Ryan OShea <ryan.oshea3@arm.com> Change-Id: Ie052e0180060203f28f64ebf54acad298f431caf
2023-07-28IVGCVSW-7860 - Fix segfault with some models in the TfLiteParserDavid Monahan
* Added boilerplate checks around the ParseStridedSlice memcpy's Signed-off-by: David Monahan <david.monahan@arm.com> Change-Id: Ied85c709dee230eb2984d3e339ed711d62ab36bd
2023-07-26IVGCVSW-7885 Add TILE to TFLite parserTeresa Charlin
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: Ic2c3a89b89f44f111e5a184c83db89ea1cb52976
2023-07-17IVGCVSW-7879 Change REVERSE_V2 from LayerWithParameters with 1 input, to ↵Tracy Narine
Layer with 2 inputs * Changing ReverseV2 to use two inputs * This is required by the backends * The ReverseV2Descriptor was removed * Tests updated * Added a Run<> templatefor inputs with different data types Signed-off-by: Tracy Narine <tracy.narine@arm.com> Change-Id: I22f947de829b4b3da6bda3a74f4ffdef4052cc25
2023-07-12Add Square as Mul in the TfLite ParserTeresa Charlin
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: I5760da9be2ed63fdfbdd5d3d7b771c310592798d
2023-07-05IVGCVSW-7833 Add ReverseV2 support to TFLite ParserTianle Cheng
* Added ReverseV2 support to TFLite Parser * Added ReverseV2 TFLite Parser unit tests * Updated Parser Docs Signed-off-by: Tianle Cheng <tianle.cheng@arm.com> Change-Id: Idb9a9213f75cd6cf01509a5d06ea5772cf56ac5b
2023-06-30IVGCVSW-7666 Add a FileComparisonExecutor to ExecuteNetwork.Colm Donelan
* Implement the "-C" command line option of executenetwork. * Add a FileComparisonExecutorFile which will read tensors from a previously written text file and compare them to the execution output. Signed-off-by: Colm Donelan <colm.donelan@arm.com> Change-Id: I8380fd263028af13d65a67fb6afd89626d1b07b8
2023-06-29Bugfix: -Werror=unused-result - unnecessary line, previously called aboveFrancis Murtagh
* this line is used earlier to initialize subgraphPtr Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Change-Id: Iff24da2acab33e59460455977e221066973532a2
2023-06-22IVGCVSW-7785 BugFix: ExpandDims not working when batch!=1Teresa Charlin
* This commit fixes partially the ticket. In ToTensorInfo() we assume batch is 1 when it is unknown. We call OutputTensorInfoFromInputs() to amend this assumption/ However, this does not work for reshape layer. Therefore, we have to calculate the output shape in the ParseExpandDims(). Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: Iedc32a44b4ec0d8b7d2cc0b08f38f0776402f7bd
2023-05-23BugFix: check for options!=null before adding fused activation in TfLite parserTeresa Charlin
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: I96fd26559450690fbe99a0e8fbe193ddf5d3a34b
2023-05-17IVGCVSW-7400 POW IVGCVSW-7278 SQUARED_DIFFERENCE.John Mcloughlin
* Added 2 new operators as ElementWiseBinary ops * Ref End to End and unit tests * Serialize and Deserialize tests * Delegate and Opaque Delegate tests * TfLite Parser tests Signed-off-by: John Mcloughlin <john.mcloughlin@arm.com> Change-Id: I537158127f602f0c41ca0402aa31655cd3bd4281
2023-04-26BugFix: calculate explicit padding for Transpose Convolution using output sizeTeresa Charlin
* If the output shape is given in Transpose convolution, use it to calculate the padding Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: I0bf3dee94c2ce606ed67fb385018b220188c3017
2023-04-19GitHub #640 Add support for CEIL operatorTeresa Charlin
* Reference workload * TfLite Delegate * TfLite Parser * Serializer and Deserializer * Changed fallback tests in delegate to use COS instead of CEIL Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: I36e0dbff33694182d1dba0c95d463506428e2f04
2023-04-18GitHub #719 Set quantization parameter scale to 1.0, instead of 0.0.Teresa Charlin
* Arm NN does not account for int8 or uint8 not quantized types, Tensorflow does. Not quantized int8 and uint8 is the same as quantized int8 and uint8 with scale = 1.0 and offset= 0 Default offset/zero_point was already 0, this review sets the default scale to 1.0. Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: Ibc3eecc281de516c2cc706e17bde01c64ff9556e
2023-03-29BugFix: Mean layer reading negative axis incorrectly in TFLite parserTeresa Charlin
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: I3ccfc2a4c95c57743927fb276faa756740f5c55a
2023-03-14IVGCVSW-3808 Add ElementwiseBinaryLayerMike Kelly
!android-nn-driver:9329 * Added ElementwiseBinaryLayer that can represent all ElementwiseBinary operations including Add, Div, Sub, Maximum, Mul and Minimum. * Updated Delegate to use ElementwiseBinaryLayer instead of the Add, Div, Sub, Maximum, Mul and Minimum layers. * Updated Deserializer to use ElementwiseBinaryLayer instead of the Add, Div, Sub, Maximum, Mul and Minimum layers. * Updated OnnxParser to use ElementwiseBinaryLayer instead of the Add layer. * Updated TfLiteParser to use ElementwiseBinaryLayer instead of the Add, Div, Sub, Maximum, Mul and Minimum layers. * Updated CL and Neon tests to use ElementwiseBinaryLayer. * Updated CL and Neon Backend Specific Optimizations to accept ElementBinaryLayers as well as Add, Div, Mul, Sub, Maximum and Minimum layers. Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: I7cbb96b60eb01f0e2b57b0541016d48a08b86c75
2023-02-24IVGCVSW-7546 SPACE_TO_DEPTH support added in tflite parserTeresa Charlin
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: I4f5016841c31b183440f31c1e177bc41d2b8dbb7
2023-02-22Fix segfault in ParseTransposeConv2d when output_shape is not constantRyan OShea
We currently check that output_shape is an input for transpose conv2d. If that is an input, we assume that it is constant and attempt to copy the data into the descriptor. When this data is not constant and instead comes from the output of another layer we segfault. When not constant we will use infer output shapes. * Adds a check into ParseTransposeConv2d that inputs[0] is constant Signed-off-by: Ryan OShea <ryan.oshea3@arm.com> Change-Id: I01176ae22974767a2306a3db749a029ed220d88b
2023-02-20IVGCVSW-7427 Execute network unable to correctly determineMike Kelly
the shape of the network * Fixed bug where calculated output shape wasn't being recorded in ParseSqueeze. Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: I8f03a0400323c865e7e8f924d257d6770f809502
2023-01-24IVGCVSW-7277 Fixed issues with FullyConnected on certain TFLite modelsMike Kelly
* TFLite Parser: * Fixed issue in ParseReshape where the targetShape wasn't always calculated correctly * Fixed issue in ParseFullyConnected where the wrong name was used for the ReshapeLayer * Added an ExpandDims to the FullyConnected to ensure that we reshape the output correctly * TFLite Delegate: * Added an ExpandDims to the FullyConnected to ensure that we reshape the output correctly Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: I129dfcb8543f8a3a297c0589c841be20ef3b6407
2023-01-12IVGCVSW-7244 ConcatLayer overlapping views on TFLiteParserMike Kelly
* Added ability to calculate dynamic tensors and propagate them through the model so that when those tensors are later used as inputs they have the right shapes. * Added InferOutputShapes to DetectionPostProcessLayer. * Added InferOutputShapes to MeanLayer. * Added InferOutputShapes to RankLayer. * Added InferOutputShapes to ReduceLayer. * Fixed typos in TfLiteParser. Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: I880c0716938ef278f5dbf01a8a73a5cc99ce5ded
2023-01-10Catch exception by reference instead of by value.Cathal Corbett
Signed-off-by: Cathal Corbett <cathal.corbett@arm.com> Change-Id: Id765f6d766e623a157b614ca935113a9f32a5801
2023-01-05GitHub #543 Problem Parsing Mixed-Precision ModelMike Kelly
* Fixed bug when converting Constants with Per-Axis Quantization Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: Ifbea23e60483746ec987da491dae96e74cb33af4
2022-09-26IVGCVSW-7158 TfLiteParser supports reshape when output 'shape_signature' ↵Cathal Corbett
param contains a value of -1. Signed-off-by: Cathal Corbett <cathal.corbett@arm.com> Change-Id: I538347083e9f22b3f3b6c048aebc2cf5cf4dc786
2022-09-22IVGCVSW-7240 Adjoint is Transpose in TFLite. Change in TFLite parserTeresa Charlin
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: I1bc3d50b8fa6e216d8b6b7e3421d2ff37a21712c
2022-09-20IVGCVSW-7040 TfLiteParser fails to prepare model due to unspecified size ↵Cathal Corbett
buffer data for Slice operator. Signed-off-by: Cathal Corbett <cathal.corbett@arm.com> Change-Id: I86735faf8d57168a63ca6657f281ec03b90f7235
2022-09-05IVGCVSW-6497: BatchMatMul TfLite ParserSamuel Yap
* Added armnnTfLiteParser for BatchMatMul * Added unit testing for parser * Updated CMakeLists Signed-off-by: Samuel Yap <samuel.yap@arm.com> Change-Id: If6842aaf7cf08f688093b714e2ecea6e8cd87161
2022-08-05IVGCVSW-7103 ExecuteNetwork failed while doing Yolov4 executionNikhil Raj
* Adding the check only if it's not a const layer which is needed to run ai_benchmark_v5_yolo_v4_tiny_quant.tflite model * We still won't be able to run the model due to IVGCVSW-7158 Signed-off-by: Nikhil Raj <nikraj01@e126673.cambridge.arm.com> Change-Id: Ib7e77a0b5a64be0c92a8e4eae45729f799770b37
2022-08-05Fix '#if defined(ARMNN_POST_TFLITE_2_3)' in TfLiteParser Conv3D test.Cathal Corbett
Signed-off-by: Cathal Corbett <cathal.corbett@arm.com> Change-Id: I5c68b81a67fc2b5a33cf62753351440564bb868e
2022-07-27IVGCVSW-7094 Add LOG and SIN support to tflite parserTeresa Charlin
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: I979a6f43c0d6ec49effb9a87339dbcd07678d2bd
2022-07-08IVGCVSW-7040 Add support for LOG_SOFTMAX to the TFLiteParserTeresa Charlin
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: I1fedfdf2cd8871d6b307fce8620f40adadf75f04
2022-06-15GitHub 653: Segfault when parsing Unidirectional Sequence LSTMMike Kelly
* Fixed Segfault when parsing Unidirectional Sequence LSTM Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: Ic69a4190c60ef595be64bc2c356e540319381b7e
2022-05-18IVGCVSW-6929 Support for models with implicit expandedMike Kelly
dimensions * Added allow-expanded-dims to TFLite parser and ArmNN delegate * If true ArmNN will disregard dimensions with a size of 1 when validating tensor shapes. Tensor sizes must still match. * This allows us to support models where tensors have expanded dimensions (i.e. extra dimensions with a size of 1). * Fixed bug in Network where it assumed that only the first option could be ShapeInferenceMethod. * Fixed bug where m_ShapeInferenceMethod was lost when copying or moving Graphs. * Changed Delegate to pass "infer-output-shape", "allow-expanded-dims" and other BackendOptions through to the Network during construction. Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: Ibe7c5ae6597796fc9164cb07bd372bd7f8f8cacf
2022-05-16IVGCVSW-6124 ConstTensorsAsInput: Conv2d - FrontEndKeith Davis
* Update Front-end and Tools. * Updated Serializer, Deserializer and unit tests to reflect this. * Updated TfLiteDelegate, TfLiteParser and OnnxParser. * Updated Ref. * Fixed resulting Neon / CL tests * Unified optimizers for conv2d ops * Optimizer Fix - Fp32ToBf16 * Partial implementation for ACL backends to fix VTS failures !android-nn-driver:7477 Signed-off-by: Keith Davis <keith.davis@arm.com> Change-Id: I5fb18877f7ee32643e15a9818945356274bb401b
2022-05-05IVGCVSW-6127 ConstTensorsAsInput: DepthwiseConvolution2dCathal Corbett
!android-nn-driver:7418 * Update Front-end and Tools. * Updated Serializer, Deserializer and unit tests to reflect this. * Updated TfLiteDelegate, TfLiteParser and OnnxParser. * Change NNDriver to new API. * Updated Ref. * Neon and Cl backend partially completed (Backend.cpp files). * Added dynamic or constant input EndToEnd tests. * Added ConstantTensorAsInputMemeberVariableRedirect Optimization. Signed-off-by: Cathal Corbett <cathal.corbett@arm.com> Change-Id: Ib18b6c10a093042e165e25237dc04a4c67ba82da
2022-05-05IVGCVSW-6938 Do not add Floor when FloorDiv is int32 in TfliteparserTeresa Charlin
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: I7ce633a66e2ecb72a9cdd1bff690c4195a9a449f
2022-05-04IVGCVSW-6936 Add SQRT support to tflite parserTeresa Charlin
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: I3b1f44c10a3446cfe45a7757d8a98e9788ec5dc0