diff --git a/setup.py b/setup.py index 7ef3652f87..0c4bbc1541 100644 --- a/setup.py +++ b/setup.py @@ -62,7 +62,7 @@ EXTRAS_REQUIRE = { "nncf": ["nncf>=2.11.0"], - "openvino": ["nncf>=2.11.0", "openvino==2024.4.1.dev20240926", "openvino-tokenizers==2024.4.1.0.dev20240926"], + "openvino": ["nncf>=2.11.0", "openvino==2024.5.0", "openvino-tokenizers==2024.5.0"], "neural-compressor": ["neural-compressor[pt]>3.0", "accelerate", "transformers<4.46"], "ipex": ["intel-extension-for-pytorch", "transformers>=4.39,<4.45"], "diffusers": ["diffusers"], diff --git a/tests/openvino/test_exporters_cli.py b/tests/openvino/test_exporters_cli.py index f218fa05ba..8ce707e142 100644 --- a/tests/openvino/test_exporters_cli.py +++ b/tests/openvino/test_exporters_cli.py @@ -50,6 +50,7 @@ from optimum.intel.utils.import_utils import ( compare_versions, is_openvino_tokenizers_available, + is_openvino_version, is_tokenizers_version, is_transformers_version, ) @@ -80,20 +81,20 @@ class OVCLIExportTestCase(unittest.TestCase): if is_transformers_version(">=", "4.45"): SUPPORTED_ARCHITECTURES.extend([("text-to-image", "stable-diffusion-3"), ("text-to-image", "flux")]) EXPECTED_NUMBER_OF_TOKENIZER_MODELS = { - "gpt2": 2 if is_tokenizers_version("<", "0.20") else 0, + "gpt2": 2 if is_tokenizers_version("<", "0.20") or is_openvino_version(">=", "2024.5") else 0, "t5": 0, # no .model file in the repository "albert": 0, # not supported yet "distilbert": 1, # no detokenizer - "roberta": 2 if is_tokenizers_version("<", "0.20") else 0, + "roberta": 2 if is_tokenizers_version("<", "0.20") or is_openvino_version(">=", "2024.5") else 0, "vit": 0, # no tokenizer for image model "wav2vec2": 0, # no tokenizer "bert": 1, # no detokenizer - "blenderbot": 2 if is_tokenizers_version("<", "0.20") else 0, - "stable-diffusion": 2 if is_tokenizers_version("<", "0.20") else 0, - "stable-diffusion-xl": 4 if is_tokenizers_version("<", "0.20") else 0, - "stable-diffusion-3": 6 if is_tokenizers_version("<", "0.20") else 2, - "flux": 4 if is_tokenizers_version("<", "0.20") else 0, - "llava": 2 if is_tokenizers_version("<", "0.20") else 0, + "blenderbot": 2 if is_tokenizers_version("<", "0.20") or is_openvino_version(">=", "2024.5") else 0, + "stable-diffusion": 2 if is_tokenizers_version("<", "0.20") or is_openvino_version(">=", "2024.5") else 0, + "stable-diffusion-xl": 4 if is_tokenizers_version("<", "0.20") or is_openvino_version(">=", "2024.5") else 0, + "stable-diffusion-3": 6 if is_tokenizers_version("<", "0.20") or is_openvino_version(">=", "2024.5") else 2, + "flux": 4 if is_tokenizers_version("<", "0.20") or is_openvino_version(">=", "2024.5") else 0, + "llava": 2 if is_tokenizers_version("<", "0.20") or is_openvino_version(">=", "2024.5") else 0, } SUPPORTED_SD_HYBRID_ARCHITECTURES = [ diff --git a/tests/openvino/test_quantization.py b/tests/openvino/test_quantization.py index 7a415c3a3a..c8ce4be89a 100644 --- a/tests/openvino/test_quantization.py +++ b/tests/openvino/test_quantization.py @@ -258,7 +258,7 @@ class OVWeightCompressionTest(unittest.TestCase): sensitivity_metric="mean_activation_magnitude", dataset=["one two, " * i for i in range(10)], ), - {"int4": 25, "int8": 14}, + {"int4": 24, "int8": 16}, ), ( OVModelForCausalLM, @@ -883,7 +883,7 @@ def preprocess_function(examples, tokenizer): class OVTrainerTest(unittest.TestCase): - SUPPORTED_ARCHITECTURES_WITH_EXPECTED_QUANTIZED_MATMULS = (("albert", 64, 39),) + SUPPORTED_ARCHITECTURES_WITH_EXPECTED_QUANTIZED_MATMULS = (("albert", 63, 39),) @parameterized.expand(SUPPORTED_ARCHITECTURES_WITH_EXPECTED_QUANTIZED_MATMULS) @unittest.skipIf(