-
Notifications
You must be signed in to change notification settings - Fork 31.2k
[Attn Masks] Lift bidirectional mask restriction on eager
#42325
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
Conversation
| allow_torch_fix (`bool`, optional): | ||
| Whether to update the mask in case a query is not attending to any tokens, to solve a bug in torch's older | ||
| versions. We need an arg to skip it when using eager. By default `True`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doubled comment, unrelated but should be removed nonetheless. Slipped through
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
ArthurZucker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a test we can add for this? Otherwise lgtm!
|
Good point, let me check if we properly skip the mask in a test here. |
|
run-slow: bart,bert,llama |
|
This comment contains models: ["models/bart", "models/bert", "models/llama"] |
CI Results✅ No failing test specific to this PR 🎉 ! |
Given that the torch compiler fuses our eager attention to sdpa automatically under compile, we should take more advantage and allow no masks on bidirectional masks without padding == fa backend. This restriction is also unnecessary and I'm not sure why I had this one to begin with.
Fuse strategies can be seen here: