Add atol for sliding window test (#30303)

atol for sliding window test
This commit is contained in:
fxmarty 2024-04-18 11:08:34 +02:00 committed by GitHub
parent 3f20877da9
commit 9459efb807
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3925,7 +3925,7 @@ class ModelTesterMixin:
# 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