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

feat: check stability of output #163

Merged
merged 3 commits into from
Nov 8, 2022
Merged

Conversation

pommedeterresautee
Copy link
Member

@pommedeterresautee pommedeterresautee commented Nov 6, 2022

fix #170

Sometimes we have bugs on masks, or race condition issues.
They may be catched by checking if the output of the kernel change in time or not.
This is inspired from https://github.com/HazyResearch/flash-attention/blob/main/tests/test_flash_attn.py#L978
The loop is smaller to not make tests too slow

Moreover, old implementations are removed as our kernel is now quite different, old implementations are of little value and make tests slower.

@pommedeterresautee
Copy link
Member Author

❯ pytest test/test_attention.py
===================================================================================================== test session starts =====================================================================================================
platform linux -- Python 3.9.15, pytest-7.2.0, pluggy-1.0.0
rootdir: /mnt/workspace/kernl
plugins: anyio-3.6.1
collected 699 items                                                                                                                                                                                                           

test/test_attention.py ................................................................................................................................................................................................ [ 27%]
....................................................................................................................................................................................................................... [ 58%]
....................................................................................................................................................................................................................... [ 88%]
.............................................................................                                                                                                                                           [100%]
...
=============================================================================================== 699 passed in 723.90s (0:12:03) ===============================================================================================

@github-actions github-actions bot added feature and removed feature labels Nov 7, 2022
Copy link
Contributor

@gaetansnl gaetansnl left a comment

Choose a reason for hiding this comment

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

single comment

# Conflicts:
#	test/test_attention.py
@pommedeterresautee pommedeterresautee merged commit 558dfc3 into main Nov 8, 2022
@pommedeterresautee pommedeterresautee deleted the feat/add_more_check branch November 8, 2022 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

catch race conditions
2 participants