-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[BugFix] test_mla_fp8.py fails on Cublas 12.9 #11360
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
cublas 12.9 Signed-off-by: Liu-congo <[email protected]>
Signed-off-by: Liu-congo <[email protected]>
Summary of ChangesHello @Liu-congo, 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 PR addresses a critical bug preventing Highlights
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.
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 aims to fix a bug in test_mla_fp8.py that occurs with Cublas 12.9 by replacing the Triton-based per_tensor_quant_mla_fp8 function with a PyTorch-based input_to_float8 function. The change appears to be correct and also shows performance improvements in the benchmarks provided.
I've identified a couple of areas for minor improvement related to redundant code, which I've detailed in the comments below. These changes will help improve code clarity.
|
|
||
|
|
||
| # temporary fix for issue #11272 | ||
| def is_nvidia_cublas_cu12_version_ge_12_9(): |
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.
Can you please move this function to python/sglang/srt/utils/common.py
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.
Got it. It's done.
Fridge003
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.
LGTM
Signed-off-by: Liu-congo <[email protected]>
Motivation
fix #11272
Modifications
replace the per_tensor_quant_mla_fp8 used in dsv2 with the to_float8 in sgl-kernel/tests/test_bmm_fp8.py
Benchmarking
cmd: python3 test/srt/test_mla_fp8.py
raw implementation on cublas12.8.4.1
{'en': np.float64(0.86), 'en:std': np.float64(0.34698703145794946), 'group_latin': np.float64(0.86), 'group_latin:std': np.float64(0.34698703145794946), 'score:std': np.float64(0.34698703145794946), 'score': np.float64(0.86)}
Total latency: 26.120 s
Score: 0.860
raw implementation on cublas12.9.1.4
failed
current implementation on cublas12.8.4.1:
{'en': np.float64(0.888), 'en:std': np.float64(0.31536645351083237), 'group_latin': np.float64(0.888), 'group_latin:std': np.float64(0.31536645351083237), 'score:std': np.float64(0.31536645351083237), 'score': np.float64(0.888)}
Total latency: 14.972 s(very magic, adding 3 more test result: 30s, 26s, 29s, the true performance might be around 28s?)
Score: 0.888
current implementation on cublas12.91.4
{'en': np.float64(0.864), 'en:std': np.float64(0.3427885645700568), 'group_latin': np.float64(0.864), 'group_latin:std': np.float64(0.3427885645700568), 'score:std': np.float64(0.3427885645700568), 'score': np.float64(0.864)}
Total latency: 25.954 s
Score: 0.864
Plan
I think the problem might caused by the triton implemented per_tensor_quant_mla_fp8, further
Checklist