fix xqa mha_sm90.cu - #2157
fix xqa mha_sm90.cu#2157
Conversation
Signed-off-by: Qidi Sang <200703406+qsang-nv@users.noreply.github.com>
WalkthroughThis PR refactors SM90 MHA kernel selection from runtime architecture checks to compile-time macro-based configuration. It updates the JIT compilation pipeline to conditionally include SM90-specific sources and flags, extends XQA operation registration with speculative query sequence length tracking, and refines runtime conditions for SM90 inference path selection to account for sink conflicts. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used🧬 Code graph analysis (1)flashinfer/jit/xqa.py (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (6)
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 |
|
/bot run |
|
[FAILED] Pipeline #39489427: 4/20 passed |
<!-- .github/pull_request_template.md --> ## 📌 Description <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> This PR fixes 2 things: 1 __CUDA_ARCH__ is not defined in host code so xqa_wrapper.cu should use another macro 2 spec_q_seq_len is not included in jit module name, which could lead to crashes in unittests because test could use wrong cached ops ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete. ### ✅ Pre-commit Checks - [ ] I have installed `pre-commit` by running `pip install pre-commit` (or used your preferred method). - [ ] I have installed the hooks with `pre-commit install`. - [ ] I have run the hooks manually with `pre-commit run --all-files` and fixed any reported issues. > If you are unsure about how to set up `pre-commit`, see [the pre-commit documentation](https://pre-commit.com/). ## 🧪 Tests - [ ] Tests have been added or updated as needed. - [ ] All tests are passing (`unittest`, etc.). ## Reviewer Notes <!-- Optional: anything you'd like reviewers to focus on, concerns, etc. --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Enhanced support for NVIDIA Hopper (SM90) GPUs with optimized compilation configuration. * **Bug Fixes** * Refined speculative decoding behavior to correctly handle edge cases with sink parameters. * **Performance Improvements** * Improved kernel selection logic for SM90-specific multi-head attention operations. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Qidi Sang <200703406+qsang-nv@users.noreply.github.com>
<!-- .github/pull_request_template.md --> ## 📌 Description <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> This PR fixes 2 things: 1 __CUDA_ARCH__ is not defined in host code so xqa_wrapper.cu should use another macro 2 spec_q_seq_len is not included in jit module name, which could lead to crashes in unittests because test could use wrong cached ops ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete. ### ✅ Pre-commit Checks - [ ] I have installed `pre-commit` by running `pip install pre-commit` (or used your preferred method). - [ ] I have installed the hooks with `pre-commit install`. - [ ] I have run the hooks manually with `pre-commit run --all-files` and fixed any reported issues. > If you are unsure about how to set up `pre-commit`, see [the pre-commit documentation](https://pre-commit.com/). ## 🧪 Tests - [ ] Tests have been added or updated as needed. - [ ] All tests are passing (`unittest`, etc.). ## Reviewer Notes <!-- Optional: anything you'd like reviewers to focus on, concerns, etc. --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Enhanced support for NVIDIA Hopper (SM90) GPUs with optimized compilation configuration. * **Bug Fixes** * Refined speculative decoding behavior to correctly handle edge cases with sink parameters. * **Performance Improvements** * Improved kernel selection logic for SM90-specific multi-head attention operations. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Qidi Sang <200703406+qsang-nv@users.noreply.github.com>
📌 Description
This PR fixes 2 things:
1 CUDA_ARCH is not defined in host code so xqa_wrapper.cu should use another macro
2 spec_q_seq_len is not included in jit module name, which could lead to crashes in unittests because test could use wrong cached ops
🔍 Related Issues
🚀 Pull Request Checklist
Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete.
✅ Pre-commit Checks
pre-commitby runningpip install pre-commit(or used your preferred method).pre-commit install.pre-commit run --all-filesand fixed any reported issues.🧪 Tests
unittest, etc.).Reviewer Notes
Summary by CodeRabbit
New Features
Bug Fixes
Performance Improvements
✏️ Tip: You can customize this high-level summary in your review settings.