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

Why Doesn't FlashAttention3 Allow KV and O to Share Memory Space? #1396

Open
ziyuhuang123 opened this issue Dec 18, 2024 · 0 comments
Open

Comments

@ziyuhuang123
Copy link

I noticed in kernel_traits that in FA3, Q and K are kept fixed in memory, while V and O can reuse the same space. However, isn't Q the only tensor that must remain fixed? (Since our block keeps moving to the right, Q must stay fixed, while K and V are continuously updated.)

Why not allow KV and O to share memory space (using a union)? Is it because O occupies very little space, making such a modification unnecessary?

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

No branches or pull requests

1 participant