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

Resolve issues between kv_cache and flash attention. #1178

Merged

Conversation

chaochen99
Copy link
Contributor

When using kv cache and flash attention in conjunction, it's crucial to set the causal parameter of flash_varlen_qkv_fn to False. Failing to do so will lead to inaccurate results.

…to set the causal parameter of flash_varlen_qkv_fn to False. Failing to do so will lead to inaccurate results.
@CLAassistant
Copy link

CLAassistant commented Mar 8, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@Quentin-Anthony Quentin-Anthony left a comment

Choose a reason for hiding this comment

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

LGTM. @haileyschoelkopf -- Please sanity-check this as well.

@haileyschoelkopf
Copy link
Contributor

LGTM to me as well--reference: https://github.com/Dao-AILab/flash-attention/blob/9818f85fee29ac6b60c9214bce841f8109a18b1b/flash_attn/modules/mha.py#L504

@Quentin-Anthony Quentin-Anthony merged commit c1fa994 into EleutherAI:main Mar 8, 2024
2 of 5 checks passed
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