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

Adjust allclose atol for the flash attention TPU test #6889

Merged
merged 2 commits into from
Apr 4, 2024

Conversation

JackCaoG
Copy link
Collaborator

@JackCaoG JackCaoG commented Apr 4, 2024

This should fix the TPU CI Failure, confirmed locally.

@@ -205,7 +205,7 @@ def test_flash_attention_wrapper(self):

o = flash_attention(q, k, v)
expected_o = self._attention(q, k, v)
self.assertTrue(torch.allclose(o.cpu(), expected_o.cpu()))
self.assertTrue(torch.allclose(o.cpu(), expected_o.cpu(), atol=1e-07))
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about using 1e-4? Just in case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

let's do 1e-5 lol, we also set the precision to highest in the test.

Copy link
Collaborator

@alanwaketan alanwaketan left a comment

Choose a reason for hiding this comment

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

LGTM.

@JackCaoG
Copy link
Collaborator Author

JackCaoG commented Apr 4, 2024

TPU CI passed, I am just going to merge.

@JackCaoG JackCaoG merged commit 73de972 into master Apr 4, 2024
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants