-
Notifications
You must be signed in to change notification settings - Fork 31.4k
[OPT] Fix attention scaling
#38290
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
[OPT] Fix attention scaling
#38290
Conversation
zucchini-nlp
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.
Thanks for handling it! I think we should remove query_states = self.q_proj(hidden_states) * self.scaling to be consistent. Should be equivalent imo
|
Thought it was equivalent too but sadly it's not. Learned the hard lesson with whisper 😢 |
|
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. |
zucchini-nlp
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.
Wow, okee, that's sad. Can we add a comment explaining why is so? Future us won't remember and refactor it out 😆
|
Haha, yea good point. I'll add a comment ^^ |
|
Added a comment |
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.
Thanks!
|
Can this also be included in the upcoming patch? It's required to pass vLLM tests |
|
yes for sure |
Scaling has been applied twice to OPT. This fixes it by passing
1.0explicitly to avoid sdpa and co. to create a default scaling.Fixes #38277