Skip to content

Commit

Permalink
flaky
Browse files Browse the repository at this point in the history
  • Loading branch information
gante committed Sep 20, 2024
1 parent 77c5d59 commit 0c51ab7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_modeling_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4711,6 +4711,7 @@ def test_custom_4d_attention_mask(self):
normalized_1 = F.softmax(out_shared_prefix_last_tokens)
torch.testing.assert_close(normalized_0, normalized_1, rtol=1e-3, atol=1e-4)

@is_flaky(max_attempts=10) # TODO @raushan: this test is VERY flaky on some VLMs, like paligemma
def test_static_cache_matches_dynamic(self):
"""
Tests that generating with static cache give almost same results as with dynamic cache.
Expand Down Expand Up @@ -4747,7 +4748,7 @@ def test_static_cache_matches_dynamic(self):
output_logits=True,
return_dict_in_generate=True,
)
self.assertTrue(torch.allclose(dynamic_out.logits[0], static_out.logits[0], rtol=1e-3, atol=1e-3))
self.assertTrue(torch.allclose(dynamic_out.logits[0], static_out.logits[0], rtol=1e-3, atol=1e-4))

# For now, Let's focus only on GPU for `torch.compile`
@slow
Expand Down

0 comments on commit 0c51ab7

Please sign in to comment.