diff --git a/tests/openvino/test_quantization.py b/tests/openvino/test_quantization.py index 83667f6a80..987ca65096 100644 --- a/tests/openvino/test_quantization.py +++ b/tests/openvino/test_quantization.py @@ -146,8 +146,8 @@ def preprocess_function(examples, tokenizer): class OVWeightCompressionTest(unittest.TestCase): # TODO : add models SUPPORTED_ARCHITECTURES_WITH_EXPECTED_COMPRESSED_MATMULS = ( - (OVModelForSequenceClassification, "hf-internal-testing/tiny-random-bert", 70, 35), - (OVModelForCausalLM, "hf-internal-testing/tiny-random-BartForCausalLM", 27, 14), + (OVModelForSequenceClassification, "hf-internal-testing/tiny-random-bert", 70, 70), + (OVModelForCausalLM, "hf-internal-testing/tiny-random-gpt2", 45, 44), ) SUPPORTED_ARCHITECTURES_WITH_AUTO_COMPRESSION = ( diff --git a/tests/openvino/test_training.py b/tests/openvino/test_training.py index 91defbefbb..9498a66ccf 100644 --- a/tests/openvino/test_training.py +++ b/tests/openvino/test_training.py @@ -318,7 +318,7 @@ def tearDown(self): "default_quantization": OVTrainerTestDescriptor( model_id="hf-internal-testing/tiny-random-bert", nncf_compression_config=DEFAULT_QUANTIZATION_CONFIG, - expected_fake_quantize=43, + expected_fake_quantize=42, expected_int8=32, compression_metrics=["compression_loss"], ), @@ -326,14 +326,14 @@ def tearDown(self): model_id="hf-internal-testing/tiny-random-bert", teacher_model_id="hf-internal-testing/tiny-random-bert", nncf_compression_config=DEFAULT_QUANTIZATION_CONFIG, - expected_fake_quantize=43, + expected_fake_quantize=42, expected_int8=32, compression_metrics=["compression_loss", "distillation_loss", "task_loss"], ), "customized_quantization": OVTrainerTestDescriptor( model_id="hf-internal-testing/tiny-random-bert", nncf_compression_config=CUSTOMIZED_QUANTIZATION_CONFIG, - expected_fake_quantize=70, + expected_fake_quantize=69, expected_int8=35, compression_metrics=["compression_loss"], ), @@ -341,7 +341,7 @@ def tearDown(self): model_id="hf-internal-testing/tiny-random-bert", teacher_model_id="hf-internal-testing/tiny-random-bert", nncf_compression_config=CUSTOMIZED_QUANTIZATION_CONFIG, - expected_fake_quantize=70, + expected_fake_quantize=69, expected_int8=35, compression_metrics=["compression_loss", "distillation_loss", "task_loss"], ), @@ -369,7 +369,7 @@ def tearDown(self): "customized_quantization,structured_movement_sparsity": OVTrainerTestDescriptor( model_id="hf-internal-testing/tiny-random-bert", nncf_compression_config=[CUSTOMIZED_QUANTIZATION_CONFIG, STRUCTURED_MOVEMENT_SPARSITY_CONFIG_FOR_BERT], - expected_fake_quantize=70, + expected_fake_quantize=69, expected_int8=35, expected_binary_masks=60, compression_metrics=["compression_loss"], @@ -378,7 +378,7 @@ def tearDown(self): model_id="hf-internal-testing/tiny-random-bert", teacher_model_id="hf-internal-testing/tiny-random-bert", nncf_compression_config=[DEFAULT_QUANTIZATION_CONFIG, STRUCTURED_MOVEMENT_SPARSITY_CONFIG_FOR_BERT], - expected_fake_quantize=43, + expected_fake_quantize=42, expected_int8=32, expected_binary_masks=60, compression_metrics=["compression_loss", "distillation_loss", "task_loss"], @@ -387,7 +387,7 @@ def tearDown(self): model_id="hf-internal-testing/tiny-random-bert", teacher_model_id="hf-internal-testing/tiny-random-bert", nncf_compression_config=[CUSTOMIZED_QUANTIZATION_CONFIG, STRUCTURED_MOVEMENT_SPARSITY_CONFIG_FOR_BERT], - expected_fake_quantize=70, + expected_fake_quantize=69, expected_int8=35, expected_binary_masks=60, compression_metrics=["compression_loss", "distillation_loss", "task_loss"], @@ -408,7 +408,7 @@ def tearDown(self): "default_quantization,unstructured_movement_sparsity": OVTrainerTestDescriptor( model_id="hf-internal-testing/tiny-random-bert", nncf_compression_config=[DEFAULT_QUANTIZATION_CONFIG, UNSTRUCTURED_MOVEMENT_SPARSITY_CONFIG_FOR_BERT], - expected_fake_quantize=43, + expected_fake_quantize=42, expected_int8=32, expected_binary_masks=60, compression_metrics=["compression_loss"], @@ -416,7 +416,7 @@ def tearDown(self): "customized_quantization,unstructured_movement_sparsity": OVTrainerTestDescriptor( model_id="hf-internal-testing/tiny-random-bert", nncf_compression_config=[CUSTOMIZED_QUANTIZATION_CONFIG, UNSTRUCTURED_MOVEMENT_SPARSITY_CONFIG_FOR_BERT], - expected_fake_quantize=70, + expected_fake_quantize=69, expected_int8=35, expected_binary_masks=60, compression_metrics=["compression_loss"], @@ -425,7 +425,7 @@ def tearDown(self): model_id="hf-internal-testing/tiny-random-bert", teacher_model_id="hf-internal-testing/tiny-random-bert", nncf_compression_config=[DEFAULT_QUANTIZATION_CONFIG, UNSTRUCTURED_MOVEMENT_SPARSITY_CONFIG_FOR_BERT], - expected_fake_quantize=43, + expected_fake_quantize=42, expected_int8=32, expected_binary_masks=60, compression_metrics=["compression_loss", "distillation_loss", "task_loss"], @@ -434,7 +434,7 @@ def tearDown(self): model_id="hf-internal-testing/tiny-random-bert", teacher_model_id="hf-internal-testing/tiny-random-bert", nncf_compression_config=[CUSTOMIZED_QUANTIZATION_CONFIG, UNSTRUCTURED_MOVEMENT_SPARSITY_CONFIG_FOR_BERT], - expected_fake_quantize=70, + expected_fake_quantize=69, expected_int8=35, expected_binary_masks=60, compression_metrics=["compression_loss", "distillation_loss", "task_loss"], diff --git a/tests/openvino/utils_tests.py b/tests/openvino/utils_tests.py index 72d4a0f810..f8abf6bc6a 100644 --- a/tests/openvino/utils_tests.py +++ b/tests/openvino/utils_tests.py @@ -98,18 +98,18 @@ _ARCHITECTURES_TO_EXPECTED_INT8 = { - "bert": (34,), - "roberta": (34,), - "albert": (42,), - "vit": (31,), - "blenderbot": (35,), - "gpt2": (22,), - "wav2vec2": (15,), - "distilbert": (33,), - "t5": (32, 52, 42), - "stable-diffusion": (74, 4, 4, 32), - "stable-diffusion-xl": (148, 4, 4, 33), - "stable-diffusion-xl-refiner": (148, 4, 4, 33), + "bert": (68,), + "roberta": (68,), + "albert": (84,), + "vit": (62,), + "blenderbot": (70,), + "gpt2": (44,), + "wav2vec2": (30,), + "distilbert": (66,), + "t5": (64, 104, 84), + "stable-diffusion": (148, 8, 8, 64), + "stable-diffusion-xl": (296, 8, 8, 66), + "stable-diffusion-xl-refiner": (296, 8, 8, 66), }