From 19499a0d08067ce7f0a1492b2a37dc851a881466 Mon Sep 17 00:00:00 2001 From: eaidova Date: Tue, 2 Jul 2024 10:23:12 +0400 Subject: [PATCH] update tests --- tests/openvino/test_exporters_cli.py | 14 ++++++++++---- tests/openvino/test_modeling.py | 6 +++++- tests/openvino/test_quantization.py | 4 ++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/tests/openvino/test_exporters_cli.py b/tests/openvino/test_exporters_cli.py index 2df03f6b34..0941d657e9 100644 --- a/tests/openvino/test_exporters_cli.py +++ b/tests/openvino/test_exporters_cli.py @@ -41,7 +41,7 @@ ) from optimum.intel.openvino.configuration import _DEFAULT_4BIT_CONFIGS from optimum.intel.openvino.utils import _HEAD_TO_AUTOMODELS -from optimum.intel.utils.import_utils import is_openvino_tokenizers_available +from optimum.intel.utils.import_utils import is_openvino_tokenizers_available, is_transformers_version class OVCLIExportTestCase(unittest.TestCase): @@ -90,20 +90,26 @@ class OVCLIExportTestCase(unittest.TestCase): ("text-generation-with-past", "opt125m", "int4_asym_g128", 62, 86), ("text-generation-with-past", "opt125m", "int4_sym_g64", 62, 86), ("text-generation-with-past", "opt125m", "int4_asym_g64", 62, 86), - ("text-generation-with-past", "llama_awq", "int4 --ratio 1.0 --sym --group-size 16 --all-layers", 0, 32), + ( + "text-generation-with-past", + "llama_awq", + "int4 --ratio 1.0 --sym --group-size 8 --all-layers", + 0, + 34 if is_transformers_version(">=", "4.39") else 32, + ), ( "text-generation-with-past", "llama_awq", "int4 --ratio 1.0 --sym --group-size 16 --awq --dataset wikitext2 --num-samples 100 " "--sensitivity-metric max_activation_variance", - 4, + 6 if is_transformers_version(">=", "4.39") else 4, 28, ), ( "text-generation-with-past", "llama_awq", "int4 --ratio 1.0 --sym --group-size 16 --scale-estimation --dataset wikitext2 --num-samples 100 ", - 4, + 6 if is_transformers_version(">=", "4.39") else 4, 28, ), ] diff --git a/tests/openvino/test_modeling.py b/tests/openvino/test_modeling.py index c7a381a0e2..3fe78bebfb 100644 --- a/tests/openvino/test_modeling.py +++ b/tests/openvino/test_modeling.py @@ -933,15 +933,18 @@ def test_beam_search(self, model_arch): do_sample=False, eos_token_id=None, ) + beam_sample_gen_config = GenerationConfig( max_new_tokens=10, min_new_tokens=10, num_beams=4, do_sample=True, eos_token_id=None, - top_k=1, ) + if model_arch == "minicpm": + beam_sample_gen_config.top_k = 1 + group_beam_search_gen_config = GenerationConfig( max_new_tokens=10, min_new_tokens=10, @@ -963,6 +966,7 @@ def test_beam_search(self, model_arch): ) gen_configs = [ + beam_sample_gen_config, beam_search_gen_config, beam_sample_gen_config, group_beam_search_gen_config, diff --git a/tests/openvino/test_quantization.py b/tests/openvino/test_quantization.py index 67970fbbcb..5951dc7fad 100644 --- a/tests/openvino/test_quantization.py +++ b/tests/openvino/test_quantization.py @@ -233,7 +233,7 @@ class OVWeightCompressionTest(unittest.TestCase): quant_method=QuantizationMethod.AWQ, scale_estimation=True, ), - 16, + 18 if is_transformers_version(">=", "4.39") else 16, ), ( OVModelForCausalLM, @@ -247,7 +247,7 @@ class OVWeightCompressionTest(unittest.TestCase): dataset="c4", quant_method="awq", ), - 16, + 18 if is_transformers_version(">=", "4.39") else 16, ), )