aboutsummaryrefslogtreecommitdiff
path: root/src/armnnUtils
AgeCommit message (Collapse)Author
2024-05-13Add deprecation notices for items to be removed in 24.08.Colm Donelan
* Onnx parser. * Async execution interface. * Shim and support library. * Arm NN converter * GpuFsa backend. Signed-off-by: Colm Donelan <colm.donelan@arm.com> Change-Id: Ia9adae4da6d9bd2b92a4f4492a022e8337f57f14
2024-03-08IVGCVSW-8299 Optimisation to replace Max + Min with Bounded ReluTeresa Charlin
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: I0774a9580710350bd0a959cf68dfe057f52e4330
2023-12-05IVGCVSW-8159 Fixed issues building with NDK r26Mike Kelly
* The compiler shipped with NDK r26 has stricter rules around certain warnings and deprecation notices. * Fixed warnings for unqualified call to 'std::move' * Fixed error where the half values weren't being cast to a float when calling 'std::nan' * Removed unnecessary subtensor unit tests for neon Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: I4ceb46e55ff5f2a754452e3a43de2188d58bf927
2023-09-18IVGCVSW-7855 removed ASSERTs from armnnUtils codeJim Flynn
Signed-off-by: Jim Flynn <jim.flynn@arm.com> Change-Id: Ie26ea2ac4a82d7460ae719fc3154c6a88b079606
2023-09-08IVGCVSW-7901 Fix unsafe Usages of Memcpy in ArmnnDavid Monahan
* Updated usages of Memcpy to use proper checks for null instead of asserts * Added error checking in places where none existed Signed-off-by: David Monahan <david.monahan@arm.com> Change-Id: I9529acd966466ba281f88918be2ec372a756e183
2023-07-12IVGCVSW-7783 Add check for FP16 infinity valuesNarumol Prangnawarat
* Check to round to closest finite FP16 value when convert FP32 to FP16 * Unit tests to be added Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: If3b982ff3030379ac33c47d4be13edb0bda679f6
2023-04-05Fix gcc 13 compiler errorsPablo Marquez Tello
* Resolves MLCE-1040 Change-Id: I32878ed70af356832403e83dcb63b0b89a8a84e3 Signed-off-by: Pablo Marquez Tello <pablo.tello@arm.com>
2023-02-21MLCE-753 Expand Tensorshape for relevent layers before verifying supportRyan OShea
Previously we were adding a reshape layer to "broadcast" tensors for elementwise operations. This broadcast was happening too late and was really just an expand dims. This was breaking the constant attributes of tensors and layer support of certain backends. * Remove addition of reshape layer when expanding dimensions * Replace broadcast function with expand dims to equal rank function * Fix some error status checks in various layers * Add new TensorUtil function that expands dims to a defined rank * Add unit tests to new TensorUtil function Signed-off-by: Ryan OShea <ryan.oshea3@arm.com> Change-Id: I31aca47c98075fef4f86864a15470f5faa55ab8d
2023-02-10IVGCVSW-7510 Delete temporary files created by DebugTestImpl.Colm Donelan
* The test cases that use DebugTestImpl were creating temporary files but not cleaning them up after running. * Refactored FileSystem to extract a common RemoveDirectoryAndContents function. Signed-off-by: Colm Donelan <colm.donelan@arm.com> Change-Id: I35b8d2eeed286742358a9abccbc078493d033902
2023-01-24IVGCVSW-7455 Workaround to allow CLBatchMatMul to parse some 4D modelsMike Kelly
* Added ability to reduce dimension sizes when calling BuildArmComputeTensorInfo or BuildArmComputeTensorShapes, this will attempt to remove leading 1s in order to squeeze the number of dimensions but retain the size. * Changed ClBatchMatMulWorkload to attempt to squeeze the number of dimensions to 3 as the CL Gemm Kernel can only support up to 3 dimensions. Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: I6b3d0886c5b97fdb686838fc3dc292833ddc4643
2023-01-18IVGCVSW-7405 Improving error handling around creating directories.Colm Donelan
The -F execute network option creates a directory to print intermediate tensors but minor problems caused serious failures. This attempts to clean up the error handling. Signed-off-by: Colm Donelan <colm.donelan@arm.com> Change-Id: Ia44c008919b1bee299b43a672235b1fcc25bf1bd
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-11-16IVGCVSW-7214 Disable BF16-Turbo-Mode and remove conversion layersRyan OShea
- Remove Bf16ToFp32 Conversion Layer - Remove Fp32ToBf16 Conversion Layer - Remove B16 Conversion tests * Throw exception if m_ReduceFp32ToBf16 optimzer option is set to true * Provide comments to enable fast math in order to use bf16 * Update docs to inform users to enable fast math for bf16 Execute Network Changes * Require bf16_turbo_mode to also have fast_math_enabled set to true - Remove setting m_ReduceFp32ToBf16 optimizer option Signed-off-by: Ryan OShea <ryan.oshea3@arm.com> Change-Id: Ibaa6da9d29c96a1ce32ff5196b0847fde9f04a1c
2022-11-02IVGCVSW-7164 Implement TosaRefBackend::OptimizeSubgraphViewMatthew Sloyan
* Added TosaRefBackend::OptimizeSubgraphView implementation. * Generalised TosaRefLayerSupport::IsLayerSupported to work with any operator. * Changed TosaCommon.hpp utils to inline functions. * Added source files for TosaMappings.hpp and AdditionOperator.hpp. * Fixed multiple defines issue with HALF_ROUND_STYLE and HALF_ROUND_TIES_TO_EVEN. Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: Ib2576ec3fb97faa3a2256b2fb93ec16ac8745760
2022-10-19MLCE-545 INT8 TFLite model execution abnormalKeith Davis
* Add functionality to print output tensors to file in tempdir * UnitTests Signed-off-by: Keith Davis <keith.davis@arm.com> Change-Id: Idfb4c186544187db1fecdfca11c662540f645439
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-04-11IVGCVSW-6707 Enables a bare metal compileJim Flynn
Change-Id: Icc2f83c5f27f413758fee3e5c1445e9fc44f42c8 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2022-03-23IVGCVSW-6706 Move headers to profiling/client/includeJim Flynn
!android-nn-driver:7337 Change-Id: Ide401623829cc99fb9b51e9bbce3482ce706a8dd Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2022-03-16IVGCVSW-6852 Break the remaining dependencies on Arm NN in the profiling codeJim Flynn
Change-Id: I18b8ca22896567904768170350ee5eb22edd4a22 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2022-03-13IVGCVSW-6848 Move Process.[ch]pp from armnnUtils to profiling/commonJim Flynn
Change-Id: I13353f50293eae565a75ccfda37209350512bbc6 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2022-03-01IVGCVSW-6704 Change the namespace from armnn::profiling to arm::pipeCathal Corbett
* Updated ABI version to 29 due to being the first ABI break in 22.05 !android-nn-driver:7226 Signed-off-by: Cathal Corbett <cathal.corbett@arm.com> Change-Id: I9c50007dcd5b5e792757e7bd1213606df5ffec36
2022-02-14IVGCVSW-6708 Break Profiling Dependence on IRuntime ExternalProfilingOptionsJim Flynn
Change-Id: I30a46f3368bbbf33019eac4fa1245f6ff69deacd Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2022-02-07IVGCVSW-6635 Move MemCopyTestImpl from acl to armnnTestUtils.Colm Donelan
* Move MemCopyTestImpl.hpp from src/backends/aclCommon/test/ to include/armnnTestutils. * Refactor MemCopyTests in aclCommon, cl and Neon. * Introduce RefMemCopyTests to exercise this utility in x86 builds. Signed-off-by: Colm Donelan <colm.donelan@arm.com> Change-Id: I8824f013d3656658ed0a2904bb79384e3af68641
2021-12-14IVGCVSW-6453 'Move the ArmNN Test Utils code to a physically separate directory'Sadik Armagan
* Created include/armnnTestUtils directory * Moved Arm NN test utils files into armnnTestUtils directory Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: I03ac54c645c41c52650c4c03b6a58fb1481fef5d
2021-11-18IVGCVSW-6452 'Move CompatibleTypes.hpp to the armnnUtils library'Sadik Armagan
* Moved CompatibleTypes.hpp to include folder * Added implementation file to source CompatibleTypes.cpp Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: I94d2bffdb82a0592943f497d4f57972151d9f2db
2021-11-17IVGCVSW-6509 Front End + Reference Workload implementationTamás Nyíri
Subtask of story: IVGCVSW-6164 Add a Pooling3d FrontEnd and Ref Implementation * Add front end * Add reference workload * Add corresponding unit tests Change-Id: Icce4146dd0a06a1da46a2def00a82d343e171750 Signed-off-by: Tamas Nyiri <tamas.nyiri@arm.com>
2021-11-08IVGCVSW-6420: Constant flag in tensor info is not set correctlyCathal Corbett
!android-nn-driver:6532 !armnn-internal-tests:372451 * Made fix to 2 out of 3 ConstTensor() constructors in Tensor.hpp to throw InvalidArgumentException when TensorInfo isConstant parameter is false. * Added new ConstTensor() constructor in Tensor.cpp to accept vector<>.data() using template<typename MemoryType>. * Fixed runtime->GetOutputTensorInfo()/GetInputTensorInfo() methods and called submethods to return TensorInfo& rather than TensorInfo. * Fixed all failing unit tests for CpuRef/CpuAcc/GpuAcc to ensure any ConstTensor created has it's TensorInfo isConstant set to true. * Added unit tests in TensorTest.cpp to ensure ConstTensor constructors throw InvalidArgumentException when TensorInfo isConstat parameter is false. * Added unit test to ensure an empty ConstTensor constructor will set TensorInfo isConatant to true. * Indentation fixes. * Fix to arm_tensor.i to add isConstant parameter to TensorInfo constructor. Added methods IsConstant() and SetConstant(). * Fix to const_tensor.py to throw ValueError when TensorInfo isConstant is set to false when constructing a ConstTensor. * Fixed PyArmnn unit tests to set TensorInfo isConstant to True when ConstTensor is used. * Added unit tests in test_const_tensor.py to ensure ConstTensor constructors throw ValueError when TensorInfo isConstat parameter is false. Signed-off-by: Cathal Corbett <cathal.corbett@arm.com> Change-Id: I44e440dd0422c366d31bbdbc77ad2b4db0bde148
2021-10-21Fixed macro redefinition in Half.hppPablo Tello
* Fixed the compiler warnings about macro redefinitions when building the driver * Resolves MLCE-622 Change-Id: I7231f9772dc0f38191853ff378670d45648ef7f6 Signed-off-by: Pablo Tello <pablo.tello@arm.com>
2021-10-20Add ConstTensorsAsInput support for Conv3dMatthew Sloyan
* Constant weights and biases are now stored as Constant layers. * Updated Serializer, Deserializer and unit tests to reflect this. * Updated TfLiteParser. * Updated Ref backend to handle constant weights and bias as inputs rather than reading from member variables. * Added Conv3d EndToEnd test. * Added NCDHW DataLayout and unit tests. Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: I10cdd354ca5f1c748730f92ffdb36bf810f83c8e
2021-10-18IVGCVSW-6450 Add Support of Models with Dynamic Batch Tensor to ONNX parserNarumol Prangnawarat
Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: Ia7dbf0735619d406d6b4e34a71f14f20d92586e6
2021-10-01IVGCVSW-6163 Add Conv3d FrontEnd and Ref ImplementationMatthew Sloyan
* Added front-end * Added Reference workload * Added Serializer & Deserializer support * Added unit tests * Added NDHWC DataLayout Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: Iec4d39e7433b5334d52fa44cf8efc6bcd39319d8
2021-09-23Fix undefined reinterpret_cast in BFloat16.hppDiego Lopez Recas
This fixes gcc builds with version 8 or above. Signed-off-by: Diego Lopez Recas <Diego.LopezRecas@arm.com> Change-Id: I4b886854f4f3391f766e95c3478d3a5f9661507a
2021-07-21NNXSW-3081 Move Filesystem.hpp and Threads.hpp to public includeRob Hughes
!android-nn-driver:5966 Change-Id: Ice0b4d2872bb0e09bfc0763034a206c3a8f24af4 Signed-off-by: Rob Hughes <robert.hughes@arm.com>
2021-06-16IVGCVSW-5826 Change weights layout for depthwise to [1,H,W,I*M]Jan Eilers
* This change is necessary because tflite uses a [1,H,W,I*M] format and uses the I*M dimension for per axis quantization. Our previous layout [M,I,H,W] can't handle the correlating quantization scales. * Updates Onnx-, TfLiteParser and TfliteDelegate * Updates the CpuRef, CpuAcc and GpuAcc backends * Adjusts unit tests * Adds test to ensure models with old layout can still be read and executed * Adds conversion function to previous layout [1,H,W,I*M] --> [M,I,H,W] which can be used by backend developers !android-nn-driver:5553 Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: Ifef23368b8c3702cf315a5838d214f7dc13c0152
2021-06-11IVGCVSW-5963 'Move unit tests to new framework'Sadik Armagan
* Used doctest in ArmNN unit tests Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: Ia9cf5fc72775878885c5f864abf2c56b3a935f1a
2021-06-02IVGCVSW-5962 Remove boost::multi_arraySadik Armagan
* Replaced all instances of boost::multi_array with flat vectors. * Updated LayerTestResult struct with new member variables. * Updated CompareTensor function to compare flat vectors and the shape. * Removed MakeTensor function from TensorHelpers.hpp. * Removed GetTensorShapeAsArray function from LayerTestResult.hpp. * Removed boost::array usage. * Removed boost::extents usages. * Removed boost::random usages. Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: Iccde9d6640b534940292ff048fb80c00b38c4743
2021-06-01IVGCVSW-5833 Move the ProfilingGuid out of Types.hpp to its own header in ↵Nikhil Raj
profiling common !android-nn-driver:5691 Signed-off-by: Nikhil Raj <nikhil.raj@arm.com> Change-Id: Ib71af0831e324ac6bd27b1a36f4a6ec1a703b14a
2021-05-18IVGCVSW-5964 Removing some remaining boost utility usages from tests.Colm Donelan
* Adding a basic PredicateResult class to replace boost::test_tools::predicate_result * Replacing all uses of boost::test_tools::predicate_result with the new armnn::PredicateResult class * Replacing use of boost::test_tools::output_test_stream output with std::ostringstream in ProfilerTests.cpp Signed-off-by: Colm Donelan <Colm.Donelan@arm.com> Change-Id: I75cdbbff98d984e26e4a50c125386b2988516fad
2021-04-21IVGCVSW-5842 Remove cross-wiring in depthwiseJan Eilers
* Reading tensor infos won't allow a permutation vector anymore. The permutation only changed the quantization dimension not the shape and was therefore misleading * The permutation of the full tensor info is now performed in armnnUtils::Permuted * Changed TfLite Parser depthwise parsing function * Added unit tests to TfLite Parser with more random data * Changed TfLite Delegate depthwise parsing function * Added unit test to the delegate with per channel quantization !android-nn-driver:5412 Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: I1f985ee69547bcaf16a72201e00a6b6fe1ef9a97
2021-01-07Fix mac build breaksKeith Mok
Signed-off-by: Keith Mok <ek9852@gmail.com> Change-Id: I4b2926342bbf8621f7b7f5695cf1526dd7281bef
2020-10-29IVGCVSW-5468 Rewrite QuantizationDataSet.cpp to avoid use of CsvReaderJames Ward
* Remove armnnUtils/CsvReader and usage * Remove armnn/CsvReaderTest and usage * Replace functionality in QuantizationDataSet.cpp Signed-off-by: James Ward <james.ward@arm.com> Change-Id: I7213904482afa93ae6d607aa5e69117c8c34ea81
2020-10-28IVGCVSW-5433 Remove boost::transform_iterator and make_transform_iteratorFinn Williams
Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I28aace7092cff5743353df1b1de8e7a4691554d3
2020-10-16IVGCVSW-5435 Add FloatingPointComparison to remove boost::math::fpc usesMatthew Sloyan
* Added FloatingPointComparison.hpp and FloatingPointComparisonTest.cpp, which compares two floats and returns true if the values are within a specified or default tolerance of each other. * Also removed boost::math::fpc from test/TensorHelpers.hpp to validate. Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: I164c32eccd213c53bb1bc4f9cd4ee4838f1781c9
2020-10-13IVGCVSW-4489 Remove remaining occurrence of boost::formatMatthew Sloyan
* Replaced with fmt::format in Descriptors.cpp. * Removed remaining boost/format headers in ArmNN codebase. * Removed additional boost header in Network.cpp Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: Ib98b83bf4ec99ef98ce7a3635ec0dd478c3e43e1
2020-10-02IVGCVSW-5297 Remove boost::format from rest of ArmNN.Colm Donelan
* Replacing calls to boost:format with fmt:format. * TensorUtils.cpp added outputShape.reserve call. Signed-off-by: Colm Donelan <Colm.Donelan@arm.com> Change-Id: I4b2ed0f72039df824a2adca9309b8a9bbb158c5b
2020-09-30IVGCVSW-4519 Remove Boost Variant and apply_visitor variantJames Ward
* replace boost::variant with mapbox::util::variant * replace boost::apply_visitor with mapbox::util::apply_visitor * replace boost::get with mapbox::util::get Signed-off-by: James Ward <james.ward@arm.com> Change-Id: I38460cabbcd5e56d4d61151bfe3dcb5681ce696e
2020-09-17IVGCVSW-5303 Remove some boost::numeric_cast from rest of ArmNNMatthew Sloyan
* Replaced with armnn/utility/NumericCast.hpp * Exclusions in TypeUtils.cpp and QuantizerVisitor.cpp * Excluded as requires float implementation in NumericCast.hpp Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: I5c4c60e7028e1a51bf9379457278d253fd37bc70
2020-08-20Bugfix: Allow permutation of QuantizationDimFrancis Murtagh
Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Change-Id: Ib98ec471e6fdd47600b7c62d0b4d19dd36e20cbd
2020-08-17Fix Windows buildRob Hughes
Change-Id: I145d220c73313e31c184b6a75ab7f4823df99919 Signed-off-by: Robert Hughes <robert.hughes@arm.com>
2020-07-29IVGCVSW-5166 Pull out the common and server side code into standalone librariesJim Flynn
Change-Id: I180f84c493a9b2be4b93b25d312ebdd9e71b1735 Signed-off-by: Jim Flynn <jim.flynn@arm.com>