From f5b026ec94a0e6759874a1665e19810d9e1ea07d Mon Sep 17 00:00:00 2001 From: ydshieh Date: Thu, 4 Sep 2025 10:05:55 +0200 Subject: [PATCH 1/2] fix --- tests/models/aimv2/test_modeling_aimv2.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/models/aimv2/test_modeling_aimv2.py b/tests/models/aimv2/test_modeling_aimv2.py index 541f13077d2a..8d6066b2a416 100644 --- a/tests/models/aimv2/test_modeling_aimv2.py +++ b/tests/models/aimv2/test_modeling_aimv2.py @@ -24,6 +24,7 @@ from transformers import Aimv2Config, Aimv2TextConfig, Aimv2VisionConfig from transformers.testing_utils import ( + is_flaky, require_torch, require_vision, slow, @@ -469,6 +470,9 @@ def test_load_vision_text_config(self): self.assertDictEqual(config.text_config.to_dict(), text_config.to_dict()) @parameterized.expand(TEST_EAGER_MATCHES_SDPA_INFERENCE_PARAMETERIZATION) + @is_flaky( + description="sdpa gets nan values in some places while eager is fine. Except those places, the values are close" + ) def test_eager_matches_sdpa_inference( self, name, From c76be0f9ed6c913661d02be058a5f492a346eac3 Mon Sep 17 00:00:00 2001 From: ydshieh Date: Thu, 4 Sep 2025 10:06:59 +0200 Subject: [PATCH 2/2] fix --- tests/models/aimv2/test_modeling_aimv2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/models/aimv2/test_modeling_aimv2.py b/tests/models/aimv2/test_modeling_aimv2.py index 8d6066b2a416..524cdc5e3016 100644 --- a/tests/models/aimv2/test_modeling_aimv2.py +++ b/tests/models/aimv2/test_modeling_aimv2.py @@ -471,7 +471,8 @@ def test_load_vision_text_config(self): @parameterized.expand(TEST_EAGER_MATCHES_SDPA_INFERENCE_PARAMETERIZATION) @is_flaky( - description="sdpa gets nan values in some places while eager is fine. Except those places, the values are close" + max_attempts=2, + description="sdpa gets nan values in some places while eager is fine. Except those places, the values are close", ) def test_eager_matches_sdpa_inference( self,