Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughExtended SM 110 compute capability support for two FP8 BMM requirement decorators and added a test skip for SM110 when Changes
Sequence Diagram(s)(omitted — changes are metadata/test guard; no multi-component new control flow) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
Summary of ChangesHello @jimmyzho, 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 expands the compatibility of FP8 batch matrix multiplication operations within the FlashInfer library to support the SM110 compute capability. It ensures that the system correctly identifies and utilizes this new hardware capability while also refining the testing suite to account for specific FP8 format limitations on SM110. 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
Activity
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 adds support for SM110 to the bmm_fp8 operation for cudnn and cublas backends. The changes look reasonable, but I've found some inconsistencies between the implementation and the tests.
Specifically, the test test_bmm_fp8 now skips all e5m2 tests on SM110, with a confusing message. This suggests that e5m2 is not supported on SM110 for any backend. However, the requirement functions for cudnn and cublas in gemm_base.py do not reflect this limitation.
I've added comments to:
- Suggest clarifying the test skip message in
tests/gemm/test_bmm_fp8.py. - Recommend updating the requirement functions in
flashinfer/gemm/gemm_base.pyto explicitly rejecte5m2on SM110 if it's indeed unsupported, which would make the API more robust.
Addressing these points will improve the clarity and correctness of the SM110 support.
|
|
||
|
|
||
| @supported_compute_capability([89, 90, 100, 103, 120, 121]) | ||
| @supported_compute_capability([89, 90, 100, 103, 110, 120, 121]) |
There was a problem hiding this comment.
The corresponding test test_bmm_fp8 skips all tests on SM110 that use e5m2 dtypes. This suggests that the cudnn backend for bmm_fp8 might not support e5m2 on SM110. If this is the case, it would be better to add a check inside _cudnn_bmm_fp8_requirement to explicitly reject this combination and raise a ValueError, for consistency with _cutlass_bmm_fp8_requirement. This would make the API more robust. For example:
from ..utils import get_compute_capability
# ... inside _cudnn_bmm_fp8_requirement
major, _ = get_compute_capability(A.device)
if major == 11 and (A.dtype == torch.float8_e5m2 or B.dtype == torch.float8_e5m2):
raise ValueError("bmm_fp8 with e5m2 is not supported on SM110 for cudnn backend")|
|
||
|
|
||
| @supported_compute_capability([89, 90, 100, 103, 120, 121]) | ||
| @supported_compute_capability([89, 90, 100, 103, 110, 120, 121]) |
There was a problem hiding this comment.
Similar to the cudnn backend, the test test_bmm_fp8 skips all tests on SM110 with e5m2 dtypes. If the cublas backend for bmm_fp8 also doesn't support e5m2 on SM110, this requirement function should be updated to raise a ValueError for this combination. This would improve API robustness and clarity. For example:
from ..utils import get_compute_capability
# ... inside _cublas_bmm_fp8_requirement
major, _ = get_compute_capability(A.device)
if major == 11 and (A.dtype == torch.float8_e5m2 or B.dtype == torch.float8_e5m2):
raise ValueError("bmm_fp8 with e5m2 is not supported on SM110 for cublas backend")| if compute_capability[0] == 11 and ( | ||
| input_dtype == torch.float8_e5m2 or mat2_dtype == torch.float8_e5m2 | ||
| ): | ||
| pytest.skip( | ||
| "Invalid combination: only cutlass supports SM110 which does not support e5m2" | ||
| ) |
There was a problem hiding this comment.
The skip message is a bit confusing. It says "only cutlass supports SM110", but this pull request appears to add SM110 support for cublas and cudnn backends as well. If the intention is that none of the backends support e5m2 on SM110, a clearer message would be helpful to avoid confusion.
| if compute_capability[0] == 11 and ( | |
| input_dtype == torch.float8_e5m2 or mat2_dtype == torch.float8_e5m2 | |
| ): | |
| pytest.skip( | |
| "Invalid combination: only cutlass supports SM110 which does not support e5m2" | |
| ) | |
| if compute_capability[0] == 11 and ( | |
| input_dtype == torch.float8_e5m2 or mat2_dtype == torch.float8_e5m2 | |
| ): | |
| pytest.skip( | |
| "e5m2 is not supported on SM110 for bmm_fp8 by any of the available backends." | |
| ) |
|
/bot run |
|
[CANCELING] Pipeline #43797611: canceled |
|
@jimmyzho, can you rebase to re-trigger the public CI/merge check? |
📌 Description
🔍 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
Tests