Add 397B compatibility#4
Open
paragon-of-brah wants to merge 2 commits intoam17an:mtp-cleanfrom
Open
Conversation
1b0c3e2 to
076c6bc
Compare
076c6bc to
ca57840
Compare
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
Add Qwen 3.5 397B Compatibility
Additional information
As per comment, in Qwen 3.5 397B MTP experts are stored in separate tensors:
mtp.layers.0.mlp.experts.0.down_proj.weight
mtp.layers.0.mlp.experts.0.gate_proj.weight
mtp.layers.0.mlp.experts.0.up_proj.weight
mtp.layers.1.mlp.experts.0.down_proj.weight
mtp.layers.1.mlp.experts.0.gate_proj.weight
mtp.layers.1.mlp.experts.0.up_proj.weight
etc.
So you get this error
convert_hf_to_gguf.py needs to be changed to deal with the differences. The way i dealt with it was to imitate the way Qwen 3.5 35B packs its MTP tensors.
I have made a quant based on the shipped Qwen 3.5 397B from the qwen team using the modified convert_hf_to_gguf.py, then I used ik_llama.cpp to make a ~q5 quant and ran it with MTP enabled.
Performance is meh, but acceptance rates are ok. I have not tuned this at all, parameters are a bit random, and I'm offloading MTP exps to CPU because I have no VRAM.
No MTP
MTP
I HAVE NOT TESTED any other Qwen version with this convert_hf_to_gguf.py, and I don't know if those work, albeit they should.
Requirements