Skip to content

Commit f556328

Browse files
test_compare_compressed_weights is updated
1 parent 6f8f09d commit f556328

9 files changed

+1256
-12
lines changed

tests/openvino/conftest.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,46 @@
99
# See the License for the specific language governing permissions and
1010
# limitations under the License.
1111

12+
import logging
13+
import os
1214
from pathlib import Path
1315

1416
import pytest
17+
from pytest import Config
1518

19+
from nncf import set_log_level
1620
from tests.cross_fw.shared.case_collection import COMMON_SCOPE_MARKS_VS_OPTIONS
1721
from tests.cross_fw.shared.case_collection import skip_marked_cases_if_options_not_specified
1822
from tests.cross_fw.shared.install_fixtures import tmp_venv_with_nncf # noqa: F401
1923
from tests.cross_fw.shared.paths import TEST_ROOT
2024

2125

2226
def pytest_addoption(parser):
27+
parser.addoption(
28+
"--regen-ref-data",
29+
action="store_true",
30+
default=False,
31+
help="If specified, the reference files will be regenerated using the current state of the repository.",
32+
)
33+
parser.addoption(
34+
"--nncf-debug",
35+
action="store_true",
36+
default=False,
37+
help="Set debug level for nncf logger.",
38+
)
2339
parser.addoption("--data", type=str, default=None, help="Directory path to cached data.")
2440

2541

42+
def pytest_configure(config: Config) -> None:
43+
regen_dot = config.getoption("--regen-ref-data", False)
44+
if regen_dot:
45+
os.environ["NNCF_TEST_REGEN_DOT"] = "1"
46+
47+
nncf_debug = config.getoption("--nncf-debug", False)
48+
if nncf_debug:
49+
set_log_level(logging.DEBUG)
50+
51+
2652
@pytest.fixture(name="data_dir")
2753
def data(request):
2854
option = request.config.getoption("--data")

tests/openvino/native/data/2024.1/reference_scales/IntegerModel_compressed_weights_int4_asym.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
{
22
"matmul_2_data": {
3+
"compressed_weight": [
4+
55,
5+
249,
6+
21,
7+
56,
8+
162,
9+
197,
10+
244,
11+
38,
12+
251,
13+
248,
14+
185,
15+
255,
16+
207,
17+
223,
18+
234,
19+
216,
20+
253,
21+
178,
22+
254,
23+
208,
24+
255
25+
],
26+
"zero_point": [
27+
0,
28+
0,
29+
0
30+
],
331
"scale": [
432
[
533
[

tests/openvino/native/data/2024.1/reference_scales/IntegerModel_compressed_weights_int4_sym.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
{
22
"matmul_2_data": {
3+
"compressed_weight": [
4+
-19,
5+
-117,
6+
-2,
7+
-20,
8+
-65,
9+
-83,
10+
-114,
11+
-3,
12+
-117,
13+
-116,
14+
-36,
15+
-117,
16+
-56,
17+
-54,
18+
-101,
19+
-84,
20+
-118,
21+
-81,
22+
-120,
23+
-112,
24+
-120
25+
],
326
"scale": [
427
[
528
[

tests/openvino/native/data/2024.1/reference_scales/IntegerModel_compressed_weights_nf4.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
{
22
"matmul_2_data": {
3+
"compressed_weight": [
4+
156,
5+
253,
6+
138,
7+
173,
8+
216,
9+
235,
10+
250,
11+
139,
12+
254,
13+
252,
14+
205,
15+
253,
16+
207,
17+
206,
18+
237,
19+
236,
20+
254,
21+
233,
22+
255,
23+
247,
24+
255
25+
],
326
"scale": [
427
[
528
[

tests/openvino/native/data/2025.2/reference_scales/IntegerModel_compressed_weights_cb4_f8e4m3.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
{
22
"matmul_2_data": {
3+
"compressed_weight": [
4+
198,
5+
194,
6+
191,
7+
187,
8+
184,
9+
178,
10+
170,
11+
0,
12+
41,
13+
49,
14+
54,
15+
57,
16+
60,
17+
64,
18+
66,
19+
70
20+
],
321
"scale": [
422
[
523
[

0 commit comments

Comments
 (0)