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

[FA-2 / Mistral] Supprot fa-2 + right padding + forward #26912

Merged

Conversation

younesbelkada
Copy link
Contributor

What does this PR do?

Fixes: #26877

There should be no reason to not support right padding + pure forward as the reason to not support generate + right padding + fa-2 is the cache mechanism for that case that slices the cache from the left.

cc @ArthurZucker

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Sounds about right, we don't really have another way to check if we are generating, so LGTM

@younesbelkada younesbelkada merged commit bc4bbd9 into huggingface:main Oct 19, 2023
18 checks passed
@younesbelkada younesbelkada deleted the mistral-fix-fa-2-forward branch October 19, 2023 13:48
staghado pushed a commit to staghado/transformers that referenced this pull request Oct 24, 2023
@zhjohnchan
Copy link

Hi @younesbelkada @ArthurZucker,

Thanks for your contribution !

This patch was removed in this RP. After tracking the commit history, I think it should be added back ?

Best,
Zhihong

@younesbelkada
Copy link
Contributor Author

Thansk for noticing @zhjohnchan ! Just made: #27125 that should revert the behaviour of this PR

EduardoPach pushed a commit to EduardoPach/transformers that referenced this pull request Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mistral with flash attention 2 and right padding
3 participants