aboutsummaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
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-11-08IVGCVSW-6527 Support the new memory API in loaded networkFinn Williams
* enable external memory management for neon and ref backends * change m_TensorMemoryVector to hold shared pointers * change input layer backend Id to match backend id of connected layer Signed-off-by: Finn Williams <finn.williams@arm.com> Change-Id: I2216a724028312eb101b290df3f224177826b1a0
2021-11-05IVGCVSW-6412 Implement CLBackend ICustomAllocatorDavid Monahan
* Added implementation of ClBackendDefaultAllocator * Added back in some pure virtual functions that were mistakenly removed from the CustomMemoryAllocatorSample * Added a new Gralloc MemorySource for memory which originates from the gpu * Added unittests Signed-off-by: David Monahan <David.Monahan@arm.com> Change-Id: Id2abb33d82697df36426f5709756c616af3e8ed7
2021-11-03Revert "IVGCVSW-6359 Added support for Float16 (Half) to Execute Network"David Monahan
This reverts commit 2d9956162dd002a41f7fb4fa6753195d33524c7f. Reason for revert: After some discussion, this does technically implement Float16 support for ExecuteNetwork, but not in a way which matches most use cases and is likely to cause issues in the future. Reverting for now. Change-Id: I4ce6de6879216e694631f5dc68e46fb793fae0a9
2021-11-02Move command line parsing in external delegate to DelegateOptionsJan Eilers
* Moves the creation of a DelegateOption object from armnn_external_delegate to DelegateOptions. * This allows this code to be reused elsewhere * Allow boolean values of DelegateOptions to be passed as strings e.g. 'true' or 'false' * Add unit tests Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: I0ada17f511027dd3f47a85142cae346464682f5a
2021-11-01IVGCVSW-6359 Added support for Float16 (Half) to Execute NetworkDavid Monahan
* Allows the user to specify float16 as a datatype * Does not contain support for float16 on the TfLiteDelegate via ExecuteNetwork Signed-off-by: David Monahan <David.Monahan@arm.com> Change-Id: Icba56feedab32662e2cf671cc46ada899cf40c6c
2021-10-29Fix armnn_external_delegate option parsingJan Eilers
* Fixed the mechanism in armnn_delegate.cpp which creates the runtime options by moving it to DelegateOptions. BackendOptions are used in the runtime options as well as in the optimizer options but need to be processed separately. * Added runtime options to DelegateOptions to make it easier to differ between backend options of the runtime and the optimization * Updated armnn_external_delegate to use runtime options * Added explanations to OptimizerOptions Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: I34235474147def261821e4576dd41a83ad492258
2021-10-28IVGCVSW-6513: Compilation failure in armnn-mobilenet-quant in ML-ExamplesFrancis Murtagh
* Move TContainer to armnnUtils library Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Change-Id: I3c0f895d11b66f6ee224ac689a19d0477f990b98
2021-10-28IVGCVSW-5636 'Implement NNAPI caching functions'Sadik Armagan
* Get number of inputs and outputs from optimized network. * Get number of cached files if backend supports caching. Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: Ie02ac123bb7df9b0593a2fe46b5bb564a5994780
2021-10-27IVGCVSW-6469 Add MirrorPad FrontEnd and Ref SupportMatthew Sloyan
* Added PaddingMode enum to PaddingDescriptor to enable Symmetric and Reflect padding. * Added Symmetric and Reflect Ref implementation. * Added Serializer & Deserializer support. * Added unit tests. Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: I4bed907b31742b32ccefe5e8ca39a6f1e5bd9dee
2021-10-26IVGCVSW-6470 Create MemoryStrategyBenchmarkJim Flynn
* Refactor the strategy library to be more generic * Shorten the names of the current strategies * Change validatorStrat to throw exceptions Change-Id: I0d9c9ef609b2d8675e5788610d1accac6767c660 Signed-off-by: Finn Williams <finwil01@e127804.cambridge.arm.com> Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2021-10-22IVGCVSW-6359 Create a single definition of TContainerDavid Monahan
* Added a single definition of TContainer to include/armnn/Utils.hpp * Change all files which contained their own identical definitions of TContainer to use the new one Signed-off-by: David Monahan <David.Monahan@arm.com> Change-Id: I63e633693a430bbbd6a29001cafa19742ef8309a
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-19IVGCVSW-6310 Update ICustomAllocator and add GetDefaultAllocator function to ↵Francis Murtagh
backends Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Change-Id: If2879e8a82692285e7fa3f4d09abd608ca28de12
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-15Refactor: Profiler moved to GraphDerek Lamberti
* This is to enable later work to instrument the Optimizer. Signed-off-by: Derek Lamberti <derek.lamberti@arm.com> Change-Id: I2cf1fe022e0d100d6d8705adfbb8cab3ffc96a86
2021-10-15Profiling instrumentation throughout the OptimizerDerek Lamberti
Signed-off-by: Derek Lamberti <derek.lamberti@arm.com> Change-Id: Ifcdafc12ca09455af2389bf84e34b6b87bbb0b15
2021-10-13IVGCVSW-6314 Pre-Importing - Create example appFrancis Murtagh
Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Change-Id: Ibfbc9088aa09d363d67010a695866e68cef823fc
2021-10-08IVGCVSW-6313 Support pre-importing outputsFinn Williams
* Add ClearImportedInputs/Outputs function to IRuntime * Add UnImport function to ITensorHandle * Remove mutex from IWorkingMemHandle Change-Id: I34c9b6e1618755e10f3b4597afa1d9a9ea97e5fe Signed-off-by: Finn Williams <finwil01@e127804.cambridge.arm.com>
2021-10-06IVGCVSW-6338 IMemoryOptimizerStrategy Create a wrapper validator strategyFrancis Murtagh
* Add validator wrapper * Add validation logic: Condition #1: All Memblocks have been assigned to a MemBin Condition #2: No Memblock is assigned to multiple MemBins Condition #3: No two Memblocks overlap in both the X and Y axis Memblocks can overlap on the X axis for SingleAxisPacking Memblocks can overlap on the Y axis or the X for MultiAxisPacking but not both * Add test strategies and tests for overlap, duplicates and unassigned blocks Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Change-Id: I7a779b35538ecf18a33b62b84512eba69eda1f86
2021-10-06IVGCVSW-6300 'IMemoryOptimizerStrategy Add strategy library and add support ↵Sadik Armagan
in BackendRegistry' * Updated IRuntime interface for providing custom memory optimizer strategy. * Enabled selecting existing memory optimizer strategy by using BackendOptions * Added MemoryOptimizerStrategyLibrary that sets one of the existing memory optimizer strategies selected by user Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: I037f8ac8efa79c0f71bd63e379101e3ad92d80c9
2021-10-02IVGCVSW-5985 Remove deprecated codeJan Eilers
* Removes deprecated AddLayer, IsLayerSupported functions * Marks the whole LayerVisitor class as deprecated not just the constructor. This required to wrap all Accept functions in a no deprecate macro because the LayerVisitor is used as a parameter in there * Removes usage of deprecated LayerVisitor and replaces it with ExecuteStrategy. This required a few structural changes in the unit tests * Adds a default implementation for IStrategy called StrategyBase * Changes pyarmnn to use non deprecated constructor for INetworkProperties and adds related unit test * Marks usage of deprecated code in pyarmnn as deprecated. This required to extend INetworkProperties to allow backwards compatibility * Removes deprecated functions from CpuAcc, GpuAcc and Ref backends Note: This patch breaks compatibility with backends that are not updated in this patch !android-nn-driver:6325 Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: Id13b6f37a74d26eadeda2da1dc92915e725ed5a5
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-24IVGCVSW-3705 Add Channel Shuffle Front end and Ref ImplementationSimon Obute
* Add front end * Add reference workload * Add unit tests * Add Serializer and Deserializer * Update ArmNN Versioning Signed-off-by: Simon Obute <simon.obute@arm.com> Change-Id: I9ac1f953af3974382eac8e8d62d794d2344e8f47
2021-09-21Fix compile error in TransformIteratorRob Hughes
The operator= functions were raising a compiler error on MSVC. The implementations of these functions also looked very suspicious as they were not behaving as a normal operator= would - they did not modify the 'this' object at all, and returned a copy rather than a reference. This patch changes them to be more conventional, which required removing the 'const' qualifier from m_fn in order to make the object assignable. Change-Id: I1c8b526581ed8973e64f1cffc43b97ac88e07699 Signed-off-by: Rob Hughes <robert.hughes@arm.com>
2021-09-15IVGCVSW-6312 Support pre-importing inputsFinn Williams
Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: Ifc5e6f2e36767cb2a5cbf281d40ec9989b581abc
2021-09-15IVGCVSW-6298 'IMemoryOptimizerStrategy Add declarations and constant layer ↵Sadik Armagan
strategy' * Added IMemoryOptimizerStrategy interface * Added ConstLayerMemoryOptimizer strategy Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: I6a92e659379e5cc39c375b669678eee8a8c08c20
2021-09-03IVGCVSW-6262 Add support for Reduce ProdTeresa Charlin
* Tflite parser * Tflite delegate * Serializer * Deserializer * Ref, CpuAcc and GpuAcc workloads Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: I601a9ee1680b372c7955d9a628857d08c3cfd377
2021-09-02MLCE-401 Added helpers to query backend typePablo Tello
Signed-off-by: Pablo Tello <pablo.tello@arm.com> Change-Id: I6c3aa179eeaefa298e5c3a08f4d35708661615f0
2021-08-26IVGCVSW-6311 Add the pre-import backend capabilityFinn Williams
* Update acl and ref backend capabilities * Add check for AsyncExecution capability in LoadedNetwork * Add new exception for capabilities Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I2f053c845a64f336e96d452793639c6e0d3eaa89
2021-08-20IVGCVSW-6249 Add ProfilingDetails Macros to all workloads in Ref, Neon, CLKeith Davis
* Add functionality to only output network details in ExNet Signed-off-by: Keith Davis <keith.davis@arm.com> Change-Id: I0c45e67193f308ce7b86f1bb1a918a266fefba2e
2021-08-18IVGCVSW-6179 Deprecate ILayerVisitorFrancis Murtagh
* Test code still using Visitor will be removed in a later patch. Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Change-Id: I01253e1af53d264918dc39498f45b96edb16678b
2021-08-17IVGCVSW-6073 Return Backend API Version to 1.0Francis Murtagh
* Backend API is still unstable and we shouldn't start to increment until we are ready, the change it was incremented in originally was also a major break due to the addition of a virtual method which would misalign the v-table. Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Change-Id: I9c15bba29fe3b3258ae592e96889402f950b2a95
2021-08-17IVGCVSW-6119: Restore FullyConnectedDescriptor::GetNumViews for backward ↵Francis Murtagh
compatibility * Deprecate publicly visible API and forward to new function name Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Change-Id: I25fe8a303b50ecb478abd35ca034ad09bd737fe4
2021-08-16IVGCVSW-5924 Update 21.08 Doxygen DocumentsMatthew Sloyan
* Added ConstantTensorAsInput note to AddFullyConnectedLayer description. Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: I1f901023b5e421ca14183dd735996c1fe5ddb3d9
2021-08-12IVGCVSW-6078 Add support for Dma_buf CustomMemoryAllocatorDavid Monahan
* Updated supported sources in ICustomAllocator * Added MemorySource to the overridden MemoryRegion in ClBackend * Added switch statements to handle mapping/unmapping of differing memory sources * Added Import handler to map allocated DmaBuf memory Signed-off-by: David Monahan <david.monahan@arm.com> Change-Id: I2125f6f6fe72363d87ead62e211fc45e4fa28b3f
2021-08-10MLCE-530 Add support for UnidirectionalSequenceLstm to RefWorkloadexperimental/daves_custom_allocator_dmabufNarumol Prangnawarat
* Add implementation of IsUnidirectionalSequenceLstmSupported to RefLayerSupport * Add RefUnidirectionalSequenceLstmWorkload * Refactor Lstm to be able to use for Lstm and SequenceLstm * Unit tests Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: Ibc066d213213a11b955dfefbe518de643298ba0c
2021-08-10Adds CustomAllocator interface and Sample AppJan Eilers
* Updates the runtime options with a CustomAllocatorMap which allows to define a CustomAllocator for specific backends * Change IBackendInternal interface to use a shared pointer to a custom allocator * Update ClBackend.hpp/cpp to use the CustomAllocator * Adds an example application and unit test which uses a CustomAllocator for GpuAcc * Refactor of the interface to use MemorySource instead of the user Mapping cl_mem directly * Modify the BackendRegistry to also hold a registry of CustomAllocators * BackendRegistry Deregister will also deregister any allocators associated with that backend id * set_global_allocator within the BaseMemoryManager so that it always matches the currently used allocator Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: I156d819686021865f4375e6cb7a5c5dec8fee9e8 Signed-off-by: David Monahan <david.monahan@arm.com>
2021-08-10IVGCVSW-6292 Allow profiling details to be switched off during profilingKeith Davis
* Add switch for network details during profiling Signed-off-by: Keith Davis <keith.davis@arm.com> Change-Id: I8bd49fd58f0e0255598106e9ab36806ee78391d6
2021-08-06IVGCVSW-5922 Update minor version for all parsers.Matthew Sloyan
Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: I3a3e5b017c307e374457b18712585dce210f8922
2021-08-06IVGCVSW-6119 ConstTensorsAsInput: FullyConnectedMatthew Sloyan
* Constant weights and biases are now stored as Constant layers. * Updated Serializer, Deserializer and unit tests to reflect this. * Updated TfLiteDelegate, TfLiteParser and OnnxParser. * Updated Schema with IsConstant and ConstantTensorsAsInputs. * Updated Ref backend to handle constant weights and bias as inputs rather than reading from member variables. * Added dynamic or constant input EndToEnd tests. !android-nn-driver:5959 Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: Ibf3cf437df1100e4b322b0d303c575c6339f9696
2021-08-05IVGCVSW-5980 Add Descriptor, TensorInfo and Convolution algorithm to JSONKeith Davis
* Add GUID as field to layer details and profiling events * Add Optional GUID param to existing tests * Improve Details macro to be inline function * Fix some formatting Signed-off-by: Keith Davis <keith.davis@arm.com> Change-Id: I66f192a90a7642b3ee8e7dda0d3f428cce002581
2021-08-04IVGCVSW-5980 JSON profiling outputKeith Davis
* Add new ProfilingDetails class to construct operator details string * Add new macro which helps append layer details to ostream * Add ProfilingEnabled to NetworkProperties so that profiling can be realised when loading the network * Add further optional info to WorkloadInfo specific to convolutions * Generalise some JsonPrinter functions into JsonUtils for reusability * Remove explicit enabling of profiling within InferenceModel as it is done when loading network * Add ProfilingDetails macros to ConvolutionWorkloads for validation Signed-off-by: Keith Davis <keith.davis@arm.com> Change-Id: Ie84bc7dc667e72e6bcb635544f9ead7af1765690
2021-07-22MLCE-530 Add front end support for UnidirectionalSequenceLstm on ArmNNNarumol Prangnawarat
Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: I57bcbdec3eb0155f41af0fe7d6abf9bac2ec86eb
2021-07-22IVGCVSW-6073 Add protected mode to ArmNN CreationOptionsJan Eilers
* Adds logic to the Runtime to activate protected mode * Adds ProtectedContentAllocation backend capability to ClBackend It's not fully activated yet because the CustomAllocator is missing. Will print an error message and won't register the backend but won't fail. * Extends IBackendInternal with an UseCustomAllocator function. * Adds related unit tests Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: I64f465c5800eb104aa90db1bbf772a4148b5072f
2021-07-22IVGCVSW-6077 Add the Custom Memory Allocator interface definitionDavid Monahan
* Added ICustomAllocator.hpp to include/armnn/backends/ * Added the ability to specify an ICustomAllocator to the CreationOptions Signed-off-by: David Monahan <david.monahan@arm.com> Change-Id: I820e468b691aa032c9bd2c1e1257dc9d02f981d9
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-07-01Fix undefined behaviour in PolymorphicDowncastMatthew Bentham
In the assertion part of PolymorphicDowncast (and PolymorphicPointerDowncast) there was an unnecessary static_cast of the source pointer to the destination type. This is unnecessary because the implicit conversion of the result pointer back to the base type is sufficient to check for correctness of the downcast, and potentially harmful because if the downcast is actually incorrect the behaviour of static_cast is undefined (not actually known to be a problem in any tested implementation). Fixes warnings detected by ubsan. Signed-off-by: Matthew Bentham <matthew.bentham@arm.com> Change-Id: I9126288cbb06564009f94e57f6ca4688fc3b53c4
2021-06-30IVGCVSW-6114 Create multiple LoadedNetworks from one OptimizedNetworkMike Kelly
* Added IOptimizedNetwork constructor that takes another IOptimizedNetwork and a ModelOptions. * Changed PreCompiledLayer to use shared_ptr rather than unique_ptr to store the PreCompiledObject (no interface changes). * Added unit tests to ensure that PreCompiledLayer::Clone() clones the pointer to the PreCompiledObject correctly. Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: I3ef56055e0d189ffce9e651882d34da16c70a240
2021-06-29IVGCVSW-6027 Add IsConstant flag to TensorInfoJan Eilers
Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: I7cb0a6a8856d8cd9949bec83c1ddce0a454fdf63