glm5-next: fall back to the deepseek4 spelling for the k-pool tensors - #9
Open
danielhanchen wants to merge 1 commit into
Open
glm5-next: fall back to the deepseek4 spelling for the k-pool tensors#9danielhanchen wants to merge 1 commit into
danielhanchen wants to merge 1 commit into
Conversation
GGUFs published before the naming settled use indexer_compressor_{gate,ape}
for the two k-pool tensors, which is the spelling deepseek4 already uses.
Try the canonical name first and fall back to that one, so those files load
without a re-download of the tensor data.
The fallback reuses the existing LLM_TENSOR_INDEXER_COMPRESSOR_{WGATE,APE}
entries, so no new enum, no new name table entry, and nothing outside this
file changes.
danielhanchen
force-pushed
the
glm5next/naming-aliases
branch
from
August 28, 2026 08:17
00a0bab to
b4eb203
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.
Follow up to my comment on ggml-org#27773. I originally wrote this as a loader change and have cut it back to a single model file, since none of it needs to touch core.
GGUFs for this model were published before the naming settled, so two conventions are in the wild:
general.architectureglm5-nextblk.N.indexer.kpool_{gate,ape}glm5nextblk.N.indexer_compressor_{gate,ape}What this changes
Only the tensor half, and only in
src/models/glm5-next.cpp: try the canonical name first, fall back to the deepseek4 spelling. It reuses the existingLLM_TENSOR_INDEXER_COMPRESSOR_{WGATE,APE}entries, so there is no new enum, no new name table entry, and nothing outside this file changes.LLM_TN_IMPL::str()is a plain enum to name lookup with no arch check, so this is just asking for a name that is already in the table.The architecture string and the 40 arch-prefixed KV keys are deliberately not aliased. Those all live in shard 1, which is 9.4 MB with zero tensor infos, so the publishers on the other spelling can rewrite that one small file instead of asking you to carry a compatibility path for it. That is our side's job, not yours.
Verification
Published
unsloth/GLM-5.3-Flash-GGUFUD-IQ1_S, shard 1 rewritten toglm5-nextin 0.338 s, both data shards left byte for byte as uploaded and still containingblk.N.indexer_compressor_*:Without the fallback the same file fails with
check_tensor_dims: tensor 'blk.3.indexer.kpool_gate.weight' not found.No other architecture can be affected, since the change is inside the GLM5-Next branch of one model file.
One note on the fallback path:
LLM_TENSOR_INDEXER_COMPRESSOR_APEis registeredGGML_OP_GET_ROWSwhileLLM_TENSOR_INDEXER_KPOOL_APEis registeredGGML_OP_ADD. Yours is the correct one, since the tensor feedsggml_add. That field only feedsselect_weight_buft, so the effect is buffer placement on one small tensor and never numerics, but it is worth knowing that files taking the fallback get the older registration.