From 5befc899fc73191f20570a6f60cf4a3d5f16ba86 Mon Sep 17 00:00:00 2001 From: fxmarty <9808326+fxmarty@users.noreply.github.com> Date: Thu, 18 Apr 2024 11:08:34 +0200 Subject: [PATCH] Add atol for sliding window test (#30303) atol for sliding window test --- tests/test_modeling_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_modeling_common.py b/tests/test_modeling_common.py index 5e6be8c04044e9..71cb28d7548555 100755 --- a/tests/test_modeling_common.py +++ b/tests/test_modeling_common.py @@ -3925,7 +3925,7 @@ def test_sdpa_matches_eager_sliding_window(self): # Only non-padding tokens are expected to match. self.assertTrue( - torch.allclose(res_eager[attention_mask == 1], res_sdpa[attention_mask == 1], rtol=1e-3) + torch.allclose(res_eager[attention_mask == 1], res_sdpa[attention_mask == 1], rtol=1e-4, atol=1e-4) ) @require_flash_attn