Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova committed Jul 2, 2024
1 parent 4da2038 commit 19499a0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
14 changes: 10 additions & 4 deletions tests/openvino/test_exporters_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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,
),
]
Expand Down
6 changes: 5 additions & 1 deletion tests/openvino/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions tests/openvino/test_quantization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -247,7 +247,7 @@ class OVWeightCompressionTest(unittest.TestCase):
dataset="c4",
quant_method="awq",
),
16,
18 if is_transformers_version(">=", "4.39") else 16,
),
)

Expand Down

0 comments on commit 19499a0

Please sign in to comment.