Fuse rms_norm, mul, quantize_q8_1#22710
Open
lnigam wants to merge 2 commits intoggml-org:masterfrom
Open
Conversation
…cks whether the consumers of MUL are all MAT_MUL and MAT_MUL weights are not F32
am17an
reviewed
May 5, 2026
| } | ||
|
|
||
| // Patch mul_node type and strides so downstream MUL_MAT sees Q8_1 | ||
| mul_node->type = GGML_TYPE_Q8_1; |
Contributor
There was a problem hiding this comment.
Changing the node like this is going to cause issues, we should find another way
am17an
requested changes
May 5, 2026
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.
Overview
Fuse rms_norm+ mul+ qunatize_q8_1
Additional information
Tested on Qwen-3.6-35B-A3B-Q4_KM model, out of 81 RMS norms 41 are fused and 40 remained unfused due to incompatible MoE gate_input which requires F32 input only.
On 5090, it gives around 3-5% perf boost:
command: ./llama-bench -m ~/trust/Qwen3.6-35B-A3B-Q4_K_M.gguf -n 32 -ngl 500 -r 5 -fa 1 -d 0,100,512,4096 -p 0
Without change:
With-change:
Requirements