Remove gidx input from MatMulNBits graph surgery#2278
Merged
xiaoyu-work merged 1 commit intomicrosoft:mainfrom Dec 18, 2025
Merged
Remove gidx input from MatMulNBits graph surgery#2278xiaoyu-work merged 1 commit intomicrosoft:mainfrom
xiaoyu-work merged 1 commit intomicrosoft:mainfrom
Conversation
d63f16a to
60ee7a4
Compare
Contributor
Author
|
@devang-ml @jambayk @gtonpe Requesting you to please review the change. |
Collaborator
|
Could you please add a unit test? Thanks! |
60ee7a4 to
8bde637
Compare
8bde637 to
cb57d80
Compare
devang-ml
approved these changes
Dec 12, 2025
Contributor
|
When are the pending Olive CI tests expected to complete? |
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.
Describe your changes
Adding a graph surgery which will remove group index input from the MatMulNBit nodes, only if the group indexes are sorted.
##Motivation:
MLAS matmulnbits kernel expects g_idx to not be passed if the node was quantized with default column-wise grouping for block-wise quantization. If g_idx is passed, it runs the unpacked compute kernel i.e dequantizes everything to fp32 and triggers a floating point matmul which significantly degrades the runtime performance.
##Impact:
Significant performance improvement for phi4 14b model without accuracy drop.