[CONFORMANCE] Add ReadMe file for new SubgraphsDumper tool (#18802)

* [CONFORMANCE] Add ReadMe file for new SubgraphsDumper tool

* Review comments apply

* move readme

* Update README.md

* Update README.md
This commit is contained in:
Irina Efode
2023-08-04 10:30:48 +00:00
committed by GitHub
parent b7331016db
commit 9b801bcff8
2 changed files with 52 additions and 0 deletions
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:21a6f0c136a6861e74e60088090e70146e161b0126fd7917aba8b6f960f23dae
size 263795
@@ -0,0 +1,49 @@
# Subgraphs Dumper Tool
The tool is designed to analyse any arbitrary scope of the models in a formats supported by OpenVINO frontends
to extract and serialize unique operations and patterns from the input models. The criteria for
uniqueness and matching are defined by implementation of twon interface classes:
* `Matcher` defines the rules for dumping operatons to the cache.
* `Extractor` defines the rules for extracting subgraphs from the models.
> NOTE:
> Please check the following architecture [diagram](./../../../../../../docs/img/subgraphs_dumper_arch_diaram.png) to get detailed information.
## Build
To build the tool, run the following commands:
```
cmake -DENABLE_FUNCTIONAL_TESTS=ON .
make subgraphsDumper
```
The outcome of a build is a `subgrpahsDumper` binary located in the building artifacts folder.
## Run
The tool takes only one required command-line parameter:
* `--input_folders` - Required. Comma separated paths to the input folders with models in Intermediate Representation format (IRs). The separator is `,`.
* `--output_folder` - Optinal. Path to the output folders where the IRs will be serialized. Default value is "output".
* `--local_cache` - Optional. Comma-separated paths to the local cache folders with IRs. The separator is `,`.
* `--path_regex` - Optional. Regular expression to be applied in input folders for recursive discovery.
* `--extract_body` - Optional. Allows extracting operation bodies to the operation cache.
* `--cache_type` - Optional. Allows extracting Operations, Subgraphs, or both types. The default value is `OP` and `GRAPH`.
Example running command:
```subgraphsDumper --input_folders /dir_0/to/models,/dir_1/to/models --output_folder /path/to/dir```
## Extraction Algorithm
1. Recursively search for all models in the provided input folders using enabled OpenVINO frontends.
2. Read models and iterate over the nodes in the OpenVINO model to extract operations and defined patterns. Parameters, Results, and Constants are ignored.
3. Clone the entity by replacing input nodes with Parameters/Constant.
4. Compare the cloned entity with previously extracted entities stored in the internal cache by running all matchers registered in the Matcher/Extractor manager's rules.
5. Serialize all cached subgraphs to the output folder in OV IR format.
## Validation
The tool is validated by a combination of Unit and Functional tests, using the based on OV approach. To run tests, execute using the following commands:
```
cmake -DENABLE_FUNCTIONAL_TESTS=ON .
make subgraphsDumperTests
./subgraphsDumperTests --gtest_filter=*
```
## Architecture Diagram
![SubgraphsDumper Architecture Diagram]((./../../../../../../docs/img/subgraphs_dumper_arch_diaram.png)