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

Flash attention 2 support ? #2027

Closed
jorgeantonio21 opened this issue Apr 7, 2024 · 2 comments
Closed

Flash attention 2 support ? #2027

jorgeantonio21 opened this issue Apr 7, 2024 · 2 comments

Comments

@jorgeantonio21
Copy link
Contributor

Does candle currently supports flash attention 2 ? (as in https://arxiv.org/abs/2307.08691) If not, how desirable is this atm ? If desirable, any suggestions on how to start working on this feature ?

I am also interested in knowing if there are future plans to eventually support Blockwise parallel transformer (https://arxiv.org/abs/2305.19370), as well as Ring Attention (https://arxiv.org/abs/2310.01889) on candle ?

@LaurentMazare
Copy link
Collaborator

Flash attention v2 is already supported in candle via the flash-attn feature flag and the candle-flash-attn directory, it's available for a bunch of examples.
Besides this, candle is extensible so it should be easy to plug the accelerated layers that you care about. You can find examples of this in text-embeddings-inference that manages pretty high performance by leveraging custom kernels.

@jorgeantonio21
Copy link
Contributor Author

This is great, thank you for the explanation @LaurentMazare !

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

2 participants