-
Notifications
You must be signed in to change notification settings - Fork 31.2k
🔴 Remove head mask in generative models #35786
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
gante
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.
🙏
(I think raising an exception is indeed the right thing to do, as we were not respecting the head_mask at all)
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.
actually happy to have mostly given that you are refactoring as well! TBH I don't mind ignoring head mask if the doc explicitly mentions that only eager uses it. Might be less work for us, less warning and aligned with kwargs that can be passed to attn integration functions
|
@ArthurZucker yeah, just removing also works since no-one seems to use it anyways. I updated each model's docs with small note about head-mask and the models now silently ignore the head-mask Maybe we can simply remove it from valid args in v5.0? |
|
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.
LGTM maybe a red light on the PR name!
ca2fd1e to
7ae5ef1
Compare
What does this PR do?
Unblocks me on #35314 (comment). This PR raises error whenever one wants to use
head_maskwithSDPA/FA2, instead of raising a warning and redirecting toeager.Note that we didn't change vision models like ViT in this PR, those models will simply fallback to eager and have no problems because they are not generative (no cache/no attn mask)
See the linked comment for reasons why we need this