🔴 Remove head mask in generative models#35786
Conversation
gante
left a comment
There was a problem hiding this comment.
🙏
(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.
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.
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