fallback to triton mm_persistent kernel when deepGemm fail#12911
Merged
zhyncs merged 3 commits intosgl-project:mainfrom Nov 9, 2025
Merged
fallback to triton mm_persistent kernel when deepGemm fail#12911zhyncs merged 3 commits intosgl-project:mainfrom
zhyncs merged 3 commits intosgl-project:mainfrom
Conversation
hebiao064
approved these changes
Nov 9, 2025
Collaborator
|
@fzyzcjy pls review |
fzyzcjy
reviewed
Nov 9, 2025
| return _matmul_persistent_deepgemm(a=a, b=b, bias=bias) | ||
| try: | ||
| return _matmul_persistent_deepgemm(a=a, b=b, bias=bias) | ||
| except RuntimeError: |
Collaborator
There was a problem hiding this comment.
nit: hmm I do hope not to do such try-catch, since it can lead to weird issues :/ What about
except RuntimeError:
raise Exception('err, you should change the if condition above to use triton in this case, blahblha')
Collaborator
Author
There was a problem hiding this comment.
Trying to understand more here, I'm thinking deepgemm is like a optimized one we can always try and if it has issue we could fallback to the triton one which should work for almost all cases instead of failing the server. What kind of issues could it lead if we fallback to triton kernel?
Collaborator
There was a problem hiding this comment.
my personal thought is, we may fallback in unexpected ways :/
Collaborator
There was a problem hiding this comment.
also, this will waste cpu time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
launch Qwen3-Next model with enabling deterministic would fail without this fix
python3 -m sglang.launch_server --model-path /shared/public/elr-models/Qwen/Qwen3-Next-80B-A3B-Instruct/ --tp 4 --context-length 262144 --mem-fraction-static 0.7 --enable-deterministic-inferenceWithout the fix:
Failure reason: DeepGEMM targets optimizations for large-scale GEMM operations. The library's design assumes matrix dimensions that can accommodate block sizes of at least 64-128 in both M and N dimensions for efficient GPU utilization.
With fix:
Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist