Files
openvino/docs/hetero-plugin.md
Nikolay Tyukaev ef45b5da8d Doc Migration (master) (#1377)
* Doc Migration from Gitlab (#1289)

* doc migration

* fix

* Update FakeQuantize_1.md

* Update performance_benchmarks.md

* Updates graphs for FPGA

* Update performance_benchmarks.md

* Change DL Workbench structure (#1)

* Changed DL Workbench structure

* Fixed tags

* fixes

* Update ie_docs.xml

* Update performance_benchmarks_faq.md

* Fixes in DL Workbench layout

* Fixes for CVS-31290

* [DL Workbench] Minor correction

* Fix for CVS-30955

* Added nGraph deprecation notice as requested by Zoe

* fix broken links in api doxy layouts

* CVS-31131 fixes

* Additional fixes

* Fixed POT TOC

* Update PAC_Configure.md

PAC DCP 1.2.1 install guide.

* Update inference_engine_intro.md

* fix broken link

* Update opset.md

* fix

* added opset4 to layout

* added new opsets to layout, set labels for them

* Update VisionAcceleratorFPGA_Configure.md

Updated from 2020.3 to 2020.4

Co-authored-by: domi2000 <domi2000@users.noreply.github.com>
2020-07-20 17:36:08 +03:00

138 lines
4.1 KiB
Markdown

# Inference Engine hetero plugin design overview {#openvino_docs_hetero_plugin}
## Subgraphs selection
Algorithm:
For each plugin
1. Select *root* node
* Node not in subgraph previously constructed
* Affinity is equal to plugin name
2. Select adjacent node to any node in already subgraph which is not in rejected list
* if there are no such nodes **end**
3. Check selected node has same affinity
4. Add node to subgraph if check was successful or add to rejected list otherwise
5. Check global condition
* Nodes in rejected list can never be added to subgraph
* Nodes not in subgraph and not in rejected list can possibly be added later
* Check subgraph topology (the only check now is there are no indirect subgraph self-references)
6. If global condition was failed remove last node from subgraph, add it to rejected list and go to step 5
* we can rollback multiple times here because rejected list is changed every time
7. Go to step 2
Example:
```
1
|
2
/ \
3 4
\ /
5
|
6
|
7
```
Nodes [1,2,3,5,6,7] are supported in plugin, [4] is not
Possible roots: [1,2,3,5,6,7]
1. Select root [1]
* Subgraph: [1]
* Rejected: []
* Global condition: ok
2. Merge [2]
* Subgraph: [1,2]
* Rejected: []
* Global condition: ok
3. Merge [3]
* Subgraph: [1,2,3]
* Rejected: []
* Global condition: ok
4. Merge [5]
* Subgraph: [1,2,3,5]
* Rejected: []
* Global condition: There is possible self-references through node [4] but we do not know yet, ok
5. Merge [6]
* Subgraph: [1,2,3,5,6]
* Rejected: []
* Global condition: There is possible self-references through node [4] but we do not know yet, ok
6. Merge [7]
* Subgraph: [1,2,3,5,6,7]
* Rejected: []
* Global condition: There is possible self-references through node [4] but we do not know yet, ok
7. Failed to merge [4]
* Subgraph: [1,2,3,5,6,7]
* Rejected: [4]
* Global condition: There is self-references through node [4], reject
8. Rollback [7]
* Subgraph: [1,2,3,5,6]
* Rejected: [4,7]
* Global condition: There is self-references through node [4], reject
9. Rollback [6]
* Subgraph: [1,2,3,5]
* Rejected: [4,6,7]
* Global condition: There is self-references through node [4], reject
10. Rollback [5]
* Subgraph: [1,2,3]
* Rejected: [4,5,6,7]
* Global condition: ok
11. There are nodes to merge **end**
Possible roots: [5,6,7]
1. Select root [5]
* Subgraph: [5]
* Rejected: []
* Global condition: ok
2. Merge [6]
* Subgraph: [5,6]
* Rejected: []
* Global condition: ok
3. Merge [7]
* Subgraph: [5,6,7]
* Rejected: []
* Global condition: ok
4. Merge [3]
* Subgraph: [3,5,6,7]
* Rejected: []
* Global condition: ok
5. Merge [2]
* Subgraph: [2,3,5,6,7]
* Rejected: []
* Global condition: There is possible self-references through node [4] but we do not know yet, ok
6. Failed to merge [4]
* Subgraph: [2,3,5,6,7]
* Rejected: [4]
* Global condition: There is self-references through node [4], reject
7. Rollback [2]
* Subgraph: [3,5,6,7]
* Rejected: [2,4]
* Global condition: ok
8. There are nodes to merge **end**
Possible roots: [] no roots, **END**
Subgraphs: [1,2,3], [3,5,6,7]
Select best subgraph:
* When we have multiple subgraphs larger ([3,5,6,7]) is always selected, always
Repeat previous steps with remaining nodes [1,2]
The final result is:
* First plugin: [3,5,6,7], [1,2]
* Second plugin: [4]
## Subgraphs self reference detection
1. For each node in network build a list of reachable node (transitive closure)
2. For each pair of nodes in subgraph find `path` nodes (nodes through one node in pair reachable to other)
* assume `src` - one node in pair, `dst` - other node in pair
* get all nodes reachable from `src`
* in those nodes find nodes through you can reach `dst` those will be our `path` node
3. Results for pairs is cached.
4. Check if there intersection between `path` nodes set and rejected nodes set for each nodes pair in subgraph
5. In case of intersection we have a self-reference and subgraph is invalid