Skip to content

Commit 72936ab

Browse files
[PT2] test alignment (#3367)
### Changes Alignment tests `tests/torch2/function_hook/quantization/` with `tests/torch/ptq`
1 parent 9f4aa76 commit 72936ab

13 files changed

+1119
-8
lines changed

nncf/torch/model_creation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,10 @@ def wrap_model(
357357
if not trace_parameters:
358358
msg = "The 'trace_parameters=False' option is not supported in the experimental tracing mode."
359359
raise nncf.InternalError(msg)
360-
from nncf.experimental.torch2.function_hook import wrap_model
360+
from nncf.experimental.torch2.function_hook import wrap_model as pt2_wrap_model
361361
from nncf.experimental.torch2.function_hook.nncf_graph.nncf_graph_builder import GraphModelWrapper
362362

363-
wrapped_model = GraphModelWrapper(wrap_model(model), example_input=example_input)
363+
wrapped_model = GraphModelWrapper(pt2_wrap_model(model), example_input=example_input)
364364
return wrapped_model
365365

366366
if not isinstance(model, torch.nn.Module):
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"__nncf_hooks.pre_hooks.features/0/0/conv2d/0__1.0": {
3+
"input_low": [
4+
[
5+
[
6+
[
7+
-1.0
8+
]
9+
]
10+
],
11+
[
12+
[
13+
[
14+
-1.0
15+
]
16+
]
17+
]
18+
],
19+
"input_high": [
20+
[
21+
[
22+
[
23+
1.0
24+
]
25+
]
26+
],
27+
[
28+
[
29+
[
30+
1.0
31+
]
32+
]
33+
]
34+
]
35+
},
36+
"__nncf_hooks.pre_hooks.features/1/0/conv2d/0__1.0": {
37+
"input_low": [
38+
[
39+
[
40+
[
41+
-1.0
42+
]
43+
]
44+
]
45+
],
46+
"input_high": [
47+
[
48+
[
49+
[
50+
1.0
51+
]
52+
]
53+
]
54+
]
55+
},
56+
"__nncf_hooks.post_hooks.x__0.0": {
57+
"input_low": [
58+
0.0
59+
],
60+
"input_high": [
61+
0.9970665574073792
62+
]
63+
},
64+
"__nncf_hooks.post_hooks.features/0/0/conv2d/0__0.0": {
65+
"input_low": [
66+
-3.8243322372436523
67+
],
68+
"input_high": [
69+
3.794454574584961
70+
]
71+
}
72+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"__nncf_hooks.pre_hooks.features/0/0/conv2d/0__1.0": {
3+
"input_low": [
4+
[
5+
[
6+
[
7+
-2.0
8+
]
9+
]
10+
],
11+
[
12+
[
13+
[
14+
-2.0
15+
]
16+
]
17+
]
18+
],
19+
"input_high": [
20+
[
21+
[
22+
[
23+
2.0
24+
]
25+
]
26+
],
27+
[
28+
[
29+
[
30+
2.0
31+
]
32+
]
33+
]
34+
]
35+
},
36+
"__nncf_hooks.pre_hooks.features/1/0/conv2d/0__1.0": {
37+
"input_low": [
38+
[
39+
[
40+
[
41+
-2.0
42+
]
43+
]
44+
]
45+
],
46+
"input_high": [
47+
[
48+
[
49+
[
50+
2.0
51+
]
52+
]
53+
]
54+
]
55+
},
56+
"__nncf_hooks.post_hooks.x__0.0": {
57+
"input_low": [
58+
0.0
59+
],
60+
"input_high": [
61+
0.9970665574073792
62+
]
63+
},
64+
"__nncf_hooks.post_hooks.features/0/0/conv2d/0__0.0": {
65+
"input_low": [
66+
-3.8243322372436523
67+
],
68+
"input_high": [
69+
3.794454574584961
70+
]
71+
}
72+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"__nncf_hooks.pre_hooks.features/0/0/conv2d/0__1.0": {
3+
"input_low": [
4+
[
5+
[
6+
[
7+
-2.0
8+
]
9+
]
10+
],
11+
[
12+
[
13+
[
14+
-2.0
15+
]
16+
]
17+
]
18+
],
19+
"input_high": [
20+
[
21+
[
22+
[
23+
2.0
24+
]
25+
]
26+
],
27+
[
28+
[
29+
[
30+
2.0
31+
]
32+
]
33+
]
34+
]
35+
},
36+
"__nncf_hooks.pre_hooks.features/1/0/conv2d/0__1.0": {
37+
"input_low": [
38+
[
39+
[
40+
[
41+
-1.0
42+
]
43+
]
44+
]
45+
],
46+
"input_high": [
47+
[
48+
[
49+
[
50+
1.0
51+
]
52+
]
53+
]
54+
]
55+
},
56+
"__nncf_hooks.post_hooks.x__0.0": {
57+
"input_low": [
58+
0.0
59+
],
60+
"input_high": [
61+
0.9970665574073792
62+
]
63+
},
64+
"__nncf_hooks.post_hooks.features/0/0/conv2d/0__0.0": {
65+
"input_low": [
66+
-3.8243322372436523
67+
],
68+
"input_high": [
69+
3.794454574584961
70+
]
71+
}
72+
}

0 commit comments

Comments
 (0)