-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a helper script for extracting an IR subgraph #2168
Added a helper script for extracting an IR subgraph #2168
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #2168 +/- ##
===========================================
+ Coverage 36.13% 36.14% +0.01%
===========================================
Files 478 480 +2
Lines 42723 43005 +282
===========================================
+ Hits 15436 15546 +110
- Misses 27287 27459 +172 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type hints would be appreciated.
@nikita-savelyevv thanks for the very clear description in PR! Could you please add more details to the script? It would be nice to have a Usage example. |
Changes
There recently have been cases of very large model IRs, for example for LLMs which can't be opened by Netron. This makes it difficult to examine model graph in general and Fake Quantize node placement in particular.
The added helper script allows to select a node from a graph and extract some subgraph around it. To control how many surrounding nodes to include,
distance
parameter is used.Usage examples
The result will be saved at
./openvino_Constant_1116858_10.xml
. An additional symbolic link will be created at./openvino_Constant_1116858_10.bin
leading to original.bin
file so that weights for the subgraph IR are visible through Netron.--distance
can be used to control the subgraph size (10 by default)The result will be saved at
./openvino_Constant_1116858_5.xml
.--output-path
can be used to control where to save the result. It can either be a file path or a directory path.The result will be saved at
./subgraphs/openvino_Constant_1116858_10.xml
.The result will be saved at
./subgraphs/Constant_1116858.xml
.Simplifying usage
A file can be run like below
after performing the following steps
ir_subgraph.py
file to PATH variablePATH=$PATH:/path/to/dir
chmod +x /path/to/ir_subgraph.py
#!/path/to/python
as the first line ofir_subgraph.py
Reason for changes
Making it easier to analyze large graphs.