aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/Layer.cpp
AgeCommit message (Collapse)Author
2024-03-13IVGCVSW-7853 Assert audit and removalDeclan-ARM
* src/armnn * src/armnn/layers Signed-off-by: Declan-ARM <decmce01@arm.com> Change-Id: Ic78cbbb59e90fbb15f893205a358c45264243721
2023-07-14IVGCVSW-7830 Add backend optimizations to remove Reshapes where possibleMike Kelly
* Added optimization to remove reshapes for Neon and Ref Backends by using overridden TensorInfos * Added ability to delete Subgraphs during Optimization * Fixed naming error in NeonEndToEndTests and CLEndToEndTests * Added LayerNameAndTypeCheck for testing. * Fixed error where layers were not marked as altered when removed in CLBackend Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: I1ac25cd4ec9821470d961831ae2c8d24882276cc
2023-07-03IVGCVSW-7828 Add an Optional TensorInfo to InputSlotMike Kelly
* Updated calls to use the new function From: GetInputSlot(n).GetConnection()->GetTensorInfo(); To: GetInputSlot(n).GetTensorInfo(); * Added UnitTests Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: I43184cc05e4472011b9347aaa820eb8deb1cd4a0
2023-02-28Add constant version of IConnectableLayer::GetConstantTensorsByRefMatthew Bentham
This makes it easier to use, particularly in backends where it is common to pass around const pointers to IConnectableLayer. The non-constant version is rewritten to use the constant version. Signed-off-by: Matthew Bentham <matthew.bentham@arm.com> Change-Id: Id3a8384447e93c213299a85ade9a667df5960534
2022-06-23NNXSW-3858: Get non-const IConnectableLayer from I/O slotsNabeel Ahmad
* Added non-const variants of existing const member functions in IInputSlot and IOutputSlot to retrieve non-const IConnectableLayer Signed-off-by: Nabeel Ahmad <nabeel.ahmad@arm.com> Change-Id: Ic3388b578324edb4d2cca36acce6560ad1ce83c5
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-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-03IVGCVSW-6811 replace ProfilingService includes with IProfilingServiceJim Flynn
Change-Id: I00521756c8a19d10bfdc98c6ef4204c7f84901c6 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-03IVGCVSW-6634 SubgraphView: Add method of returning a GetSubgraphWorkingCopyFrancis Murtagh
* Add pointer to SubgraphView allowing it to store a working copy implementation of its own representation of graph. * Make SubgraphView a friend of Graph to allow access to layers. * Add constructor to SubgraphView taking SubgraphViewWorkingCopyPtr * Rewrite Graph::SubstituteSubgraph for use on SubgraphView * Add GetWorkingCopy() method * Add tests for replacement of multiplication with DepthwiseConv2d * Check GetBackendHint() has value before passing to PrecompiledLayer * Add GetOwningIConnectableLayer to IInputSlot to allow traversing from IConnectableLayer->IOutputSlot->IInputSlot->IConnectableLayer Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Change-Id: Iaaef14448d8b73867eaee9d69f4f98d5d1bf171c
2022-02-02IVGCVSW-6639 Add GetParameters to IConnectableLayerJim Flynn
Change-Id: Id55a460ecb510f5b30235b03f54390f2c8188fc2 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2022-01-14IVGCVSW-6633 SubgraphView uses IConnectableLayer rather than Layer in its ↵Francis Murtagh
m_Layers * Added IInputSlot, IOutputSlot and IConnectableLayer to SubgraphView * Deprecated old member functions * Removed deprecated calls in ArmNN * Added GetOwningIConnectableLayer function to IOutputSlot * Updates ArmNN Core Major version for IOutputSlot ABI break * Updated Minor version of TfliteParser, OnnxParser and Delegate Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Change-Id: I2a8611bfabf5ae09d3602fe6a4bef166e18117b9
2021-12-15IVGCVSW-6626 Promote backend headers in backendCommon to armnn/backendsColm Donelan
Move the following header files from backendsCommon to armnn/backends. * MemCopyWorkload.hpp * TensorHandle.hpp * Workload.hpp * WorkloadData.hpp * WorkloadFactory.hpp Replace them with forwarding headers and a pragma deprecation message. Resolve the deprecation messages in Arm NN code. Signed-off-by: Colm Donelan <colm.donelan@arm.com> Change-Id: I47f116b30f86e478c9057795bc518c391a8ae514
2021-05-08IVGCVSW-5818 Enable import on GPUNarumol Prangnawarat
Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: I4e4eb107aa2bfa09625840d738001f33152e6792
2021-05-06IVGCVSW-5815 Generalise ConstCpuTensorHandleJames Conroy
* Generalises ConstCpuTensorHandle and inherited classes by removing 'Cpu' from aliases. * New renamed classes: ConstTensorHandle, TensorHandle, ScopedTensorHandle, PassthroughTensorHandle, ConstPassthroughTensorHandle. Signed-off-by: James Conroy <james.conroy@arm.com> Change-Id: I1824e0e134202735fb77051f20a7252f161dfe16
2021-04-29IVGCVSW-5819 5820 5821 Add MemorySourceFlags to ↵Francis Murtagh
TensorHandleFactoryRegistry::GetFactory * Modify Layer::CreateTensorHandles to include MemorySource * Modify INetworkProperties to add MemorySource * Disable Neon/Cl fallback tests until full import implementation complete Change-Id: Ia4fff6ea3d4bf6afca33aae358125ccaec7f9a38 Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
2021-04-07Fix graph copy memory spikeFinn Williams
* Change layer storage of ConstTensors to std::shared_ptr<ConstCpuTensorHandle> * Change clone to share ConstTensor rather than copy * Remove uses of non-const GetTensor() call * Reduce scope of non-optimized network in ExeNet, so memory can be released after use Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: Ibb2c7309d12411d21405bd6024c76bcdf5404545
2021-02-12IVGCVSW-4893 Refactor ILayerVisitor using unified interface strategy.Finn Williams
Signed-off-by: Jan Eilers <jan.eilers@arm.com> Signed-off-by: Finn Williams <Finn.Williams@arm.com> Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Change-Id: Id7bc8255a8e3f9e5aac65d510bec8a559bf37246
2020-11-17IVGCVSW-5535 Extend dump file with info about fused layersMike Kelly
* Add optional ActivationDescriptor information to SerializeLayerParameters Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: I6268932cdc4637cdb30948e1b7f0f0649ba18492
2020-11-09IVGCVSW-5327 Add to Layer a binary blob to host the activation layer infoKeith Davis
Signed-off-by: Keith Davis <keith.davis@arm.com> Change-Id: I0a07dea96a86849701ba387dbea148909a6d729b
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-10-01Include layer GUID in SerializeToDot outputRob Hughes
Change-Id: I1a6df60683cc51fcd9739b6dc98f1e722becf045 Signed-off-by: Robert Hughes <robert.hughes@arm.com>
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-07-26IVGCVSW-5155 Update Arm NN API to allow for call to shape inferenceFinn Williams
Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I0a2babe5b5b09eb81c9900dc3a05071034a0440b
2020-07-10IVGCVSW-4929 Implement ShapeInferenceMethod in all LayersFinn Williams
Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I2c2d99f97cf89814140b057a9f93f41b364197f5
2020-06-03remove BOM from filesLaurent Carlier
Change-Id: Ia4b4bb3be0ed6e933c77d58f8e9879b1370e9537 Signed-off-by: Laurent Carlier <laurent.carlier@arm.com>
2020-05-19IVGCVSW-4669 Set destination tensorInfo in MoveAllConnections()Finn Williams
Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I3563209dcb3db1b40cf2db3855adc631b5e323be
2020-04-06IVGCVSW-4485 Remove Boost assertNarumol Prangnawarat
* Change boost assert to armnn assert * Change include file to armnn assert * Fix ARMNN_ASSERT_MSG issue with multiple conditions * Change BOOST_ASSERT to BOOST_TEST where appropriate * Remove unused include statements Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: I5d0fa3a37b7c1c921216de68f0073aa34702c9ff
2020-03-18IVGCVSW-4463 Change ProfilingService to a member of runtime from a singletonSadik Armagan
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: I345c39a10a4693a500aa1687d9a5cee76da791c3
2020-03-10IVGCVSW-4482 Remove boost::ignore_unusedJan Eilers
!referencetests:229377 Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: Ia9b360b4a057fe7bbce5b268092627c09a0dba82
2020-03-03IVGCVSW-4314 Per-layer backend hint APIDerek Lamberti
Change-Id: I6ddcffe792e39b17fcdb8af7f13f4a689ef8019d Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
2019-12-31IVGCVSW-4246 Clean build Layers with -WextraDerek Lamberti
Change-Id: I649cd2304fb0040164763d31a12fc77c6c3bed87 Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
2019-12-05Replace boost logging with simple loggerDerek Lamberti
!referencetests:214319 * Reduces arm nn binary size ~15% * Also fixed test logging black hole issues Change-Id: Iba27db304d9a8088fa46aeb0b52225d93bb56bc8 Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
2019-11-08IVGCVSW-4067 Change LayerGuid to use ProfilingGuidjaneil01
* Refactoring to enable ProfilingGuid * Add profiling includes to Android.mk Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: Ieb25e15e3dc302eb42817d824ad8411ac76dcfe8
2019-09-24IVGCVSW-3623 Implement NeonTensorHandle::ImportDavid Monahan
Signed-off-by: David Monahan <david.monahan@arm.com> Change-Id: I7213788725fd4e4cf1176998604e999d0b7ed6cc
2019-09-04IVGCVBENCH-1337 Added additional layer parameters to dot file and -v optionAndre Ghattas
* Generic layer parameters now show up in dot file * Convolution layer parameters have also been added to dot file * ExecucteNetwork has an additional -v flag which generated dot file if there Change-Id: I210bb19b45384eb3639b7e488c7a89049fa6f18d Signed-off-by: Andre Ghattas <andre.ghattas@arm.com> Signed-off-by: Szilard Papp <szilard.papp@arm.com>
2019-08-05IVGCVSW-3277 Mem export/import suppor for TensorsDerek Lamberti
* Rename MemoryStrategy to EdgeStrategy * Add MemImportLayer * Import memory rather than copy when possible Change-Id: I1d3a9414f2cbe517dc2aae9bbd4fdd92712b38ef Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
2019-06-24IVGCVSW-3277 Refactor TensorHandle factory APIDerek Lamberti
* Added backend support for multiple types of TensorHandle factories * Refactored the backend API to enable new tensor strategies * Added mechanism to determine memory strategies during optimization * Perform mem-copy only when Direct access is not found * Explicitly deleted the copy-constructor from OutputSlot to prevent accidental local copies that would cause the DisconnectAll to be called by the destructor Change-Id: I7e812c8e5e6c1c20db1c5932749ac70fd93db7f8 Signed-off-by: Derek Lamberti <derek.lamberti@arm.com> Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
2019-04-30IVGCVSW-3021 Add end-to-end flow control integration testMatthew Bentham
Currently asserts that the net fails to optimise as that is the expected behaviour, but it's complete enough to exercise most of the code in SwitchLayer.cpp and MergeLayer.cpp Also, fix a bug in SwitchLayer::ValidateTensorShapesFromInputs found by the new test. Also, make topological sort slightly more robust to missing connections as it should not be the job of the sorter to validate the graph. Change-Id: I30b9e2d4769ab14a6820284871a79a5bb3eef1ef Signed-off-by: Matthew Bentham <matthew.bentham@arm.com>
2019-02-11IVGCVSW-2531 Serialize a simple ArmNN NetworkMike Kelly
Change-Id: I68cf5072aca6e3a8b3b8c57e19b6d417cd5813fc Signed-off-by: Mike Kelly <mike.kelly@arm.com>
2019-02-08IVGCVSW-2672 Code cleanup after changesMatteo Martincigh
* Minor code cleanup and refactoring Change-Id: I9c6390c15944686134ddf4b47839762f2bb13922 Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
2019-02-06IVGCVSW-2606 Produce quantized InputNetwork from simple FP32 InputNetworkDerek Lamberti
Change-Id: I2140a7af5961ddf8267fbb127202de3900ea79e3 Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
2019-01-11IVGCVSW-2454 Refactor ArmNN to support pluggable backends from a separateMatteo Martincigh
code base * Made the virtual functions in ILayerSupport.hpp pure * Created a LayerSupportBase class with the default implementation of the interface * Made the backend layer support classes inherit from the base class, instead of directly from the interface * Refactored the profiler and the profiling event classes to use the BackendId instead of the Compute * Implemented a proper MemCopy support method * Changed Compute to BackendId in the profiling API and objects * Removed static references to pluggable backends !android-nn-driver:492 Change-Id: Id6332b5f48c980819e0a09adc818d1effd057296
2018-11-19IVGCVSW-2168: Remove DataLayout from LayerAron Virginas-Tar
Change-Id: Iab6ad04e5c786e4e639578f7b1d1537dd1196e2f
2018-11-02IVGCVSW-1946: Remove armnn/src from the include pathsAron Virginas-Tar
Change-Id: I663a0a0fccb43ee960ec070121a59df9db0bb04e
2018-10-22IVGCVSW-2019 : replace Compute enum in the Layer objectDavid Beck
Change-Id: I76551d511ef718eac36e5b8e5fe426ec3a402855
2018-10-10IVGCVSW-1900 : CL backend folder structureDavid Beck
* moving backends/ClWorkloads to backends/cl * and moving pure Cl workload related code to backends/cl/workloads Change-Id: I019a3c6b4da5e7a23074bf03fb057e63199ad129
2018-10-10IVGCVSW-1883 Add support for different memory layoutsDerek Lamberti
Change-Id: I6e9973bf25acad980fb4e96af8080ac829db0d28