-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
SM120 / NVFP4: add device guard and runtime SM dispatch to cutlass_scaled_fp4_mm #29711
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
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces runtime SM dispatch for cutlass_scaled_fp4_mm, which is a solid improvement to support multiple GPU architectures and fixes issues on newer hardware like the 5090 series. The change from compile-time to runtime dispatch also corrects a latent critical bug where the previous implementation would attempt to return a value from a void function. The new logic is more robust and the improved error message is a good addition. I have one suggestion to refactor the dispatch logic to improve its long-term maintainability and make it less error-prone when adding support for future architectures.
|
Hey @hholtmann , should this PR be merged to the main branch instead of In the mean time, cc @mgoin @tlrmchlsmth |
|
This pull request has merge conflicts that must be resolved before it can be |
ProExpertProg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diff seems polluted, can you rebase/merge from main?
Signed-off-by: mgoin <mgoin64@gmail.com>
|
@ProExpertProg I'm working on it |
51bcb3b to
0edf9ef
Compare
|
I tested this on my DGX Spark (sm121), was able to reproduce the original issue, and confirm that this fixes the failing tests in Reproduction StepsAfter taking the steps above, all of the tests in that file failed. Verification StepsAfter applying the fix from this PR and rebuilding, all tests passed. |
|
Excellent work @bbrowning, thank you for validating 🙏 |
fix(cuda): add device guard and runtime SM dispatch to cutlass_scaled_fp4_mm
Purpose
Currently, the fp4 scaled_mm function doesn't work for the 5090 GPU, resulting in a RuntimeError: Internal Error. See #21274 and #22783 for more informatio
Test Plan
pytest -v -s tests/kernels/quantization/test_nvfp4_scaled_mm.py
Test Result
All passed.