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

Llama: always convert the causal mask in the SDPA code path #29663

Merged
merged 2 commits into from Mar 21, 2024

Conversation

gante
Copy link
Member

@gante gante commented Mar 14, 2024

What does this PR do?

Removes the if condition to apply the used-defined attention_mask on causal_mask: it is not required for correctness, and it prevents correct left-padding behavior in compile mode (related PR: #29374).

I could not observe any performance degradation with eager dynamic cache nor with compiled static cache 🙌

@gante gante requested a review from fxmarty March 14, 2024 20:24
@HuggingFaceDocBuilderDev

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.

Copy link
Collaborator

@fxmarty fxmarty left a comment

Choose a reason for hiding this comment

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

LGTM

@gante gante requested a review from amyeroberts March 19, 2024 16:50
Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Thanks!

@gante gante merged commit ee38fc3 into huggingface:main Mar 21, 2024
19 checks passed
@gante gante deleted the always_convert_mask branch March 21, 2024 16:30
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.

None yet

4 participants