Skip to content
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

Introduced versioning of reference for conformance tests #2805

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/post_training/data/wc_reference_data_2024.3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
tinyllama_data_aware_awq_scale_estimation_backend_OV:
metric_value: 0.84038
tinyllama_data_aware_awq_scale_estimation_stateful_backend_OV:
metric_value: 0.84038
tinyllama_data_aware_gptq_backend_OV:
metric_value: 0.81936
16 changes: 14 additions & 2 deletions tests/post_training/test_quantize_conformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import yaml

import nncf
from tests.openvino.native.common import get_openvino_version
from tests.post_training.model_scope import PTQ_TEST_CASES
from tests.post_training.model_scope import WC_TEST_CASES
from tests.post_training.pipelines.base import BackendType
Expand Down Expand Up @@ -75,12 +76,23 @@ def fixture_extra_columns(pytestconfig):
return pytestconfig.getoption("extra_columns")


def ref_data_correction(data: Dict, file_name: str):
correction_data_path = Path(__file__).parent / "data" / f"{file_name}_{get_openvino_version()}.yaml"
if correction_data_path.exists():
with correction_data_path.open() as f:
correction_data = yaml.safe_load(f)

for m_name, c_data in correction_data.items():
data[m_name].update(c_data)
return data


@pytest.fixture(scope="session", name="ptq_reference_data")
def fixture_ptq_reference_data():
path_reference = Path(__file__).parent / "data" / "ptq_reference_data.yaml"
with path_reference.open() as f:
data = yaml.safe_load(f)
return data
return ref_data_correction(data, "ptq_reference_data")


@pytest.fixture(scope="session", name="wc_reference_data")
Expand All @@ -98,7 +110,7 @@ def fixture_wc_reference_data():
if "atol" not in fp32_test_cases[fp32_case_name]:
fp32_test_cases[fp32_case_name]["atol"] = 1e-10
data.update(fp32_test_cases)
return data
return ref_data_correction(data, "wc_reference_data")


@pytest.fixture(scope="session", name="ptq_result_data")
Expand Down
Loading