-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PT] add metatype for torch2 (#3107)
### Changes Add metatype to NNCFGraph Add "NNCF_EXPERIMENTAL_TORCH_TRACING" env variable to disable patching, and select experimental tracing in algorithms in feature Add `get_reference_graph` function to collect metatype in reference graph ### Related tickets 152996
- Loading branch information
1 parent
e1802b7
commit 5189aab
Showing
20 changed files
with
14,907 additions
and
14,837 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 15 additions & 15 deletions
30
tests/torch2/data/function_hook/nncf_graph/convert_to_nncf_graph.dot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
strict digraph { | ||
"0 x" [id=0, type=nncf_model_input]; | ||
"1 conv.weight" [id=1, type=nncf_model_const]; | ||
"2 conv.bias" [id=2, type=nncf_model_const]; | ||
"3 conv/conv2d/0" [id=3, type=conv2d]; | ||
"4 __nncf_hooks.post_hooks.conv/conv2d/0__0.0.w" [id=4, type=nncf_model_const]; | ||
"5 conv/post_hook__conv-conv2d-0__0[0]/add/0" [id=5, type=add]; | ||
"6 /relu/0" [id=6, type=relu]; | ||
"7 output" [id=7, type=nncf_model_output]; | ||
"0 x" -> "3 conv/conv2d/0" [label="(1, 1, 3, 3)", style=solid]; | ||
"1 conv.weight" -> "3 conv/conv2d/0" [label="(1, 1, 1, 1)", style=solid]; | ||
"2 conv.bias" -> "3 conv/conv2d/0" [label="(1,)", style=solid]; | ||
"3 conv/conv2d/0" -> "5 conv/post_hook__conv-conv2d-0__0[0]/add/0" [label="(1, 1, 3, 3)", style=solid]; | ||
"4 __nncf_hooks.post_hooks.conv/conv2d/0__0.0.w" -> "5 conv/post_hook__conv-conv2d-0__0[0]/add/0" [label="(1,)", style=solid]; | ||
"5 conv/post_hook__conv-conv2d-0__0[0]/add/0" -> "6 /relu/0" [label="(1, 1, 3, 3)", style=solid]; | ||
"6 /relu/0" -> "7 output" [label="(1, 1, 3, 3)", style=solid]; | ||
x [id=0, metatype=PTInputNoopMetatype, type=nncf_model_input]; | ||
"conv.weight" [id=1, metatype=PTConstNoopMetatype, type=nncf_model_const]; | ||
"conv.bias" [id=2, metatype=PTConstNoopMetatype, type=nncf_model_const]; | ||
"conv/conv2d/0" [id=3, metatype=PTConv2dMetatype, type=conv2d]; | ||
"__nncf_hooks.post_hooks.conv/conv2d/0__0.0.w" [id=4, metatype=PTConstNoopMetatype, type=nncf_model_const]; | ||
"conv/post_hook__conv-conv2d-0__0[0]/add/0" [id=5, metatype=PTAddMetatype, type=add]; | ||
"/relu/0" [id=6, metatype=PTRELUMetatype, type=relu]; | ||
output [id=7, metatype=PTOutputNoopMetatype, type=nncf_model_output]; | ||
x -> "conv/conv2d/0" [dtype=float, shape="(1, 1, 3, 3)"]; | ||
"conv.weight" -> "conv/conv2d/0" [dtype=float, shape="(1, 1, 1, 1)"]; | ||
"conv.bias" -> "conv/conv2d/0" [dtype=float, shape="(1,)"]; | ||
"conv/conv2d/0" -> "conv/post_hook__conv-conv2d-0__0[0]/add/0" [dtype=float, shape="(1, 1, 3, 3)"]; | ||
"__nncf_hooks.post_hooks.conv/conv2d/0__0.0.w" -> "conv/post_hook__conv-conv2d-0__0[0]/add/0" [dtype=float, shape="(1,)"]; | ||
"conv/post_hook__conv-conv2d-0__0[0]/add/0" -> "/relu/0" [dtype=float, shape="(1, 1, 3, 3)"]; | ||
"/relu/0" -> output [dtype=float, shape="(1, 1, 3, 3)"]; | ||
} |
10 changes: 5 additions & 5 deletions
10
tests/torch2/data/function_hook/nncf_graph/convert_to_nncf_graph_multi_edges.dot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
strict digraph { | ||
"0 x" [id=0, type=nncf_model_input]; | ||
"1 /add/0" [id=1, type=add]; | ||
"2 output" [id=2, type=nncf_model_output]; | ||
"0 x" -> "1 /add/0" [label="parallel_input_port_ids [1], shape (1, 1)", style=solid]; | ||
"1 /add/0" -> "2 output" [label="(1, 1)", style=solid]; | ||
x [id=0, metatype=PTInputNoopMetatype, type=nncf_model_input]; | ||
"/add/0" [id=1, metatype=PTAddMetatype, type=add]; | ||
output [id=2, metatype=PTOutputNoopMetatype, type=nncf_model_output]; | ||
x -> "/add/0" [dtype=float, parallel_input_port_ids="[1]", shape="(1, 1)"]; | ||
"/add/0" -> output [dtype=float, shape="(1, 1)"]; | ||
} |
Oops, something went wrong.