aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/SubgraphViewSelector.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-01-12IVGCVSW-7418 Allow working copy SubgraphView to get Original SlotsFrancis Murtagh
* API to remove need for workaround so backend users can get slots * OutputSlots outside the SubgraphView needed to obtain TensorInfo * Fix a few Copyright headers * Add shared_ptr back to original subgraph view using std::enable_shared_from_this Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Change-Id: I033a00d6fc4020619d406ac06a156b7e380a426a
2022-09-15Make SubgraphViewSelector give deterministic resultsRob Hughes
The subgraphs produced by SubgraphViewSelector were not produced in a deterministic order, as the order was determined by the pointer values of some objects, which are not guaranteed to be the same for each execution. This patch adds a post-processing sorting step based on the GUIDs of the layers and the slot indices so that the results will be the same for each execution. This makes debugging the optimised graph much easier as subsequent stages can also be deterministic. It also simplifies some unit tests. Change-Id: I64f552706b7fb1bf82c19d85a448e054277917bc Signed-off-by: Rob Hughes <robert.hughes@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-03-01Make SubgraphViewSelector give deterministic resultsRob Hughes
The subgraphs produced by SubgraphViewSelector were not deterministic as the order of the input slots, outputs slots and layers within each subgraph were determined by the pointer values of those objects, which are not guaranteed to be the same for each execution. This patch adds a post-processing sorting step based on the GUIDs of the layers and the slot indices so that the results will be the same for each execution. This makes debugging the optimised graph much easier as subsequent stages can also be deterministic. Change-Id: Ifbcb199733066f99e9f95808a8da22023e5944f1 Signed-off-by: Rob Hughes <robert.hughes@arm.com>
2020-04-10IVGCVSW-4483 Remove boost::polymorphic_downcastJan Eilers
* exchange boost::polymorphic_downcast with armnn::PolymorphicDowncast * remove unnecessary includes of boost::polymorphic_downcast Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: Ie603fb82860fe05fee547dc78073230cc62b2e1f
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-10IVGCVSW-4482 Remove boost::ignore_unusedJan Eilers
!referencetests:229377 Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: Ia9b360b4a057fe7bbce5b268092627c09a0dba82
2019-11-15NNXSW-1853 Change SubgraphViewSelector algorithmRob Hughes
The current algorithm in SubgraphViewSelector has a bug that can lead to it producing subgraphs which have a dependency cycle (see the newly added test case 'ValidMerge' for a repro). It also fails to merge subgraphs in some cases where it could, which leads to smaller subgraphs. In the case of FSRCNN, the NPU cannot support these smaller subgraphs and so this is blocking us from supporting that network. This commit changes the algorithm to fix the dependency bug and also make it so that subgraphs are merged in the cases that were missed before. It also adds some unit tests to cover cases that were problematic before, and to extend coverage for the new algorithm. The new algorithm has two downsides compared to the previous one: 1. Disjoint subgraphs are not merged. This can never lead to a failed compilation by the NPU and so I believe this is less of an issue than the previous algorithm's "missed merges". This could however lead to a runtime performance loss in some cases as the NPU will be unable to parallelise as many operations. There are some unit tests that cover this which I have disabled. 2. The performance is worse. I have spent some time analysing this and for a graph with ~1000 layers the new algorithm takes 20ms vs. the old algorithm's 4ms (on my desktop PC). I believe the performance is still within acceptable limits. I also compared inception V3 (which was the network which caused performance issues with the original version of the splitting algorithm) and this new algorithm has not regressed there (200-300us in both cases). Change-Id: I1dd64a779f272723621e04d203b5a2752a6af2ef Signed-off-by: Robert Hughes <robert.hughes@arm.com>
2019-05-21IVGCVSW-3015 Fix duplicate input/output slots in sub-graphMatteo Martincigh
* Avoid collecting duplicate input/output slots during the sub-graph selection process * Fixes the InceptionV3 quantized run Change-Id: I737ec8576d57184d3d25bda436a7776ec7243a0d Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
2019-05-20IVGCVSW-3030 Add unit testing for the Optimization APIMatteo Martincigh
* Added OptimizeSubgraphViewTests file covering a number of use cases for the Optimization API * Fixed a bug in the sub-graph selector algorithm that skipped the first layer in a sub-graph if it wasn't an input layer * Changed the graph splitting logic to make use of maps instead of unordered_maps to keep the split sub-graphs in consistent order between executions * Added more common unit test utils * Minor fixes to comply to the include file conventions Change-Id: Iad464eaedd004109e5ef41aa487cea3ad86177d3 Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
2019-05-07IVGCVSW-2989 Generate subgraphs without cyclic dependenciesDerek Lamberti
Change-Id: I45f81aa4ca8a964e423594fe271825c4a52b21f4 Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
2019-05-03IVGCVSW-3029 Remove any AddLayer capabilities from SubgraphViewMatteo Martincigh
* Removed the reference to the parent graph in SubgraphView * Removed the AddLayer method in SubgraphView * Updated the code where necessary to adapt to the new changes in SubgraphView * Fixed a check in the CreatePreCompiledWorkloadTest test function Change-Id: I4d3af87f11ec3cd8f18a21b250a2d295da56e1a0 Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
2019-04-30IVGCVSW-2405 Rename SubGraph to SubgraphViewDerek Lamberti
Change-Id: Ie50aeccf053c20c3a01a75042bbc3acd824375af Signed-off-by: Derek Lamberti <derek.lamberti@arm.com> Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>