Skip to content

Commit c24bf74

Browse files
[PT2] Add port ids to reference graphs (#3267)
### Changes Add `in_port_id` and `out_port_id` fields for edge data in reference files. ### Reason for changes To check port_ids in for edge
1 parent c619360 commit c24bf74

33 files changed

+14950
-14926
lines changed

tests/torch2/data/function_hook/nncf_graph/convert_to_nncf_graph.dot

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ x [id=0, metatype=PTInputNoopMetatype, type=nncf_model_input];
77
"conv/post_hook__conv-conv2d-0__0[0]/add/0" [id=5, metatype=PTAddMetatype, type=add];
88
"/relu/0" [id=6, metatype=PTRELUMetatype, type=relu];
99
output [id=7, metatype=PTOutputNoopMetatype, type=nncf_model_output];
10-
x -> "conv/conv2d/0" [dtype=float, shape="(1, 1, 3, 3)"];
11-
"conv.weight" -> "conv/conv2d/0" [dtype=float, shape="(1, 1, 1, 1)"];
12-
"conv.bias" -> "conv/conv2d/0" [dtype=float, shape="(1,)"];
13-
"conv/conv2d/0" -> "conv/post_hook__conv-conv2d-0__0[0]/add/0" [dtype=float, shape="(1, 1, 3, 3)"];
14-
"__nncf_hooks.post_hooks.conv/conv2d/0__0.0.w" -> "conv/post_hook__conv-conv2d-0__0[0]/add/0" [dtype=float, shape="(1,)"];
15-
"conv/post_hook__conv-conv2d-0__0[0]/add/0" -> "/relu/0" [dtype=float, shape="(1, 1, 3, 3)"];
16-
"/relu/0" -> output [dtype=float, shape="(1, 1, 3, 3)"];
10+
x -> "conv/conv2d/0" [dtype=float, in_port_id=0, out_port_id=0, shape="(1, 1, 3, 3)"];
11+
"conv.weight" -> "conv/conv2d/0" [dtype=float, in_port_id=1, out_port_id=0, shape="(1, 1, 1, 1)"];
12+
"conv.bias" -> "conv/conv2d/0" [dtype=float, in_port_id=2, out_port_id=0, shape="(1,)"];
13+
"conv/conv2d/0" -> "conv/post_hook__conv-conv2d-0__0[0]/add/0" [dtype=float, in_port_id=0, out_port_id=0, shape="(1, 1, 3, 3)"];
14+
"__nncf_hooks.post_hooks.conv/conv2d/0__0.0.w" -> "conv/post_hook__conv-conv2d-0__0[0]/add/0" [dtype=float, in_port_id=1, out_port_id=0, shape="(1,)"];
15+
"conv/post_hook__conv-conv2d-0__0[0]/add/0" -> "/relu/0" [dtype=float, in_port_id=0, out_port_id=0, shape="(1, 1, 3, 3)"];
16+
"/relu/0" -> output [dtype=float, in_port_id=0, out_port_id=0, shape="(1, 1, 3, 3)"];
1717
}

tests/torch2/data/function_hook/nncf_graph/convert_to_nncf_graph_multi_edges.dot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ strict digraph {
22
x [id=0, metatype=PTInputNoopMetatype, type=nncf_model_input];
33
"/add/0" [id=1, metatype=PTAddMetatype, type=add];
44
output [id=2, metatype=PTOutputNoopMetatype, type=nncf_model_output];
5-
x -> "/add/0" [dtype=float, parallel_input_port_ids="[1]", shape="(1, 1)"];
6-
"/add/0" -> output [dtype=float, shape="(1, 1)"];
5+
x -> "/add/0" [dtype=float, in_port_id=0, out_port_id=0, parallel_input_port_ids="[1]", shape="(1, 1)"];
6+
"/add/0" -> output [dtype=float, in_port_id=0, out_port_id=0, shape="(1, 1)"];
77
}

tests/torch2/data/function_hook/nncf_graph/model_graph_convnext_small.dot

Lines changed: 727 additions & 727 deletions
Large diffs are not rendered by default.

tests/torch2/data/function_hook/nncf_graph/model_graph_densenet121.dot

Lines changed: 1573 additions & 1573 deletions
Large diffs are not rendered by default.

tests/torch2/data/function_hook/nncf_graph/model_graph_efficientnet_b0.dot

Lines changed: 577 additions & 577 deletions
Large diffs are not rendered by default.

tests/torch2/data/function_hook/nncf_graph/model_graph_inception_v3.dot

Lines changed: 822 additions & 822 deletions
Large diffs are not rendered by default.

tests/torch2/data/function_hook/nncf_graph/model_graph_mobilenet_v2.dot

Lines changed: 426 additions & 426 deletions
Large diffs are not rendered by default.

tests/torch2/data/function_hook/nncf_graph/model_graph_mobilenet_v3_small.dot

Lines changed: 383 additions & 383 deletions
Large diffs are not rendered by default.

tests/torch2/data/function_hook/nncf_graph/model_graph_resnet18.dot

Lines changed: 180 additions & 180 deletions
Large diffs are not rendered by default.

tests/torch2/data/function_hook/nncf_graph/model_graph_resnext50_32x4d.dot

Lines changed: 459 additions & 459 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)