fallback to fa2 (instead of fa3) for unsupported configuration (bf16 Q, Fp8 KV)#2536
fallback to fa2 (instead of fa3) for unsupported configuration (bf16 Q, Fp8 KV)#2536
Conversation
Summary of ChangesHello @saltyminty, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an incompatibility issue where the Flash Attention 3 (FA3) backend was being incorrectly selected for certain configurations involving FP8 KV cache and non-FP8 query data types, specifically on Hopper GPUs. By adding a precise check, the system will now correctly fall back to Flash Attention 2 (FA2) in these unsupported scenarios, preventing potential errors and ensuring optimal performance. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly adds a check to is_fa3_backend_supported to handle an unsupported configuration where the KV cache is FP8 but the query is not, ensuring a fallback to the fa2 backend. The change is logical and addresses the issue described. I have one minor suggestion to improve the readability and consistency of the new conditional logic.
📝 WalkthroughWalkthroughThe PR tightens FA3 backend validation in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@saltyminty please rebase the PR onto the latest main to kick off CI. |
77b93af to
fa95004
Compare
|
/bot run |
|
[FAILED] Pipeline #43829833: 15/20 passed |
📌 Description
When the KV cache dtype is FP8, Q dtype is BF16, GPU is hopper, and the backend is set to "auto", we should set the backend as "fa2" instead of "fa3".
🔍 Related Issues
#2348
🚀 Pull Request Checklist
Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete.
🧪 Tests
unittest, etc.).Reviewer Notes
Summary by CodeRabbit