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

update tests for compatibility with ov 2025.0 #1133

Merged
merged 1 commit into from
Jan 30, 2025
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
4 changes: 2 additions & 2 deletions tests/openvino/test_exporters_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ class OVCLIExportTestCase(unittest.TestCase):
"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
"distilbert": 1 if is_openvino_version("<", "2025.0") else 2, # no detokenizer before 2025.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
"bert": 1 if is_openvino_version("<", "2025.0") else 2, # no detokenizer before 2025.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,
Expand Down
2 changes: 1 addition & 1 deletion tests/openvino/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1661,7 +1661,7 @@ def test_compare_to_transformers(self, model_arch):
with torch.no_grad():
transformers_outputs = transformers_model(**tokens, **decoder_inputs)
# Compare tensor outputs
self.assertTrue(torch.allclose(ov_outputs.logits, transformers_outputs.logits, atol=1e-4))
self.assertTrue(torch.allclose(ov_outputs.logits, transformers_outputs.logits, atol=5e-3))
gen_config = GenerationConfig(
max_new_tokens=10,
min_new_tokens=10,
Expand Down
2 changes: 1 addition & 1 deletion tests/openvino/test_quantization.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ def preprocess_function(examples, tokenizer):


class OVTrainerTest(unittest.TestCase):
SUPPORTED_ARCHITECTURES_WITH_EXPECTED_QUANTIZED_MATMULS = (("albert", 63, 39),)
Copy link
Collaborator

@nikita-savelyevv nikita-savelyevv Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is due to the fact that this test is somewhat non-deterministic (ticket 142945)

SUPPORTED_ARCHITECTURES_WITH_EXPECTED_QUANTIZED_MATMULS = (("albert", 61, 39),)

@parameterized.expand(SUPPORTED_ARCHITECTURES_WITH_EXPECTED_QUANTIZED_MATMULS)
@unittest.skipIf(
Expand Down