Repository navigation
[Bugfix][GLM-5.3] Fit the kpool-widened sparse top-k buffer to the 2048-wide SM120 index without a config edit #55563
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
Closed
cameronzucker
wants to merge
3
commits into
vllm-project:main
from
cameronzucker:glm53-kpool-topk-fit
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
326f719
[Bugfix][GLM-5.3] Fit the kpool-widened sparse top-k buffer to the 20…
cameronzucker 02d742d
[Bugfix][GLM-5.3] Apply the sparse top-k fit to the MTP draft as well
cameronzucker ae00f93
[Bugfix][GLM-5.3] Fix undefined tail in the target buffer sizing afte…
cameronzucker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
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.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Reject
index_topkvalues that the model does not fit.Line 224 truncates oversized values for validation.
fit_sparse_index_topkdoes not modify values above 2048. Forindex_topk=4096andindex_kpool=4, this check passes withfitted=2045, but model construction retains 4096 and allocates a 4224-wide buffer. The selected SM120 backend then receives a buffer wider than its 2048-wide kernel.Reject values above 2048 before deriving
fitted, or mirror the helper predicate exactly.Proposed fix
kpool = getattr(hf_text_config, "index_kpool", 1) or 1 tail = kpool - 1 if kpool > 1 else 0 - fitted = min(int(index_topk), 2048 - tail) if tail else int(index_topk) + index_topk = int(index_topk) + if index_topk > 2048: + return f"FLASHINFER_MLA_SPARSE_SM120 requires index_topk <= 2048; got {index_topk}" + fitted = 2048 - tail if tail and index_topk + tail > 2048 else index_topk if ((fitted + tail + 127) // 128) * 128 != 2048:📝 Committable suggestion
🤖 Prompt for AI Agents