Repository navigation
Conversation
Contributor
|
Tested this PR against a case not covered in the description: the Gemma 4 assistant (
|
ravel7524
force-pushed
the
fix-model-saver-per-layer-arrays
branch
from
October 26, 2026 15:57
44b48fc to
7c02d60
Compare
ravel7524
force-pushed
the
fix-model-saver-per-layer-arrays
branch
from
November 6, 2026 06:47
7c02d60 to
be2ed4e
Compare
This branch has not been deployed
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
This PR fixes GGUF save/reload failures for models with MTP (
nextn) layers.llama_model_save_to_file()wrote per-layer arrays for the main layers only, while the loader expects all layers, including MTP.Per-layer arrays now use
n_layer_all, exceptattention.indexer.types, which keeps the main-layer length and is always an array. All four readers (glm-dsa, glm5-next, hy-v4 and dots3note) accept arrays; dots3note requires one.The saver emits this key for every architecture: its scalar-to-array encoding changed in 132/134 generated GGUFs, with identical tensor bytes; architectures that do not read the key ignore it.
Additional information
Reproduction: save Qwen3.5-0.8B Q8_0 with
llama_model_save_to_file(), then reload it:qwen35.attention.recurrent_layers has wrong array length; expected 25, got 24. With the new regression test applied to baseline masterf711c8f30,test-llama-archs -a qwen35exits 255 withexpected 3, got 2; it passes with the fix.CPU testing:
test-llama-archs: 139/139 passed, seeds 1 and 42, including MTP coverage for qwen35 and mixed-indexer glm-dsa.The regression dates from the hparams refactor #24060. #30880 overlaps the saver and test refactor; I will rebase this fix if that lands first.
Requirements