Skip to content

glm5-next: fall back to the deepseek4 spelling for the k-pool tensors - #9

Open
danielhanchen wants to merge 1 commit into
timkhronos:GLM5.3-Flashfrom
unslothai:glm5next/naming-aliases
Open

glm5-next: fall back to the deepseek4 spelling for the k-pool tensors#9
danielhanchen wants to merge 1 commit into
timkhronos:GLM5.3-Flashfrom
unslothai:glm5next/naming-aliases

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Aug 28, 2026

Copy link
Copy Markdown

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.architecture k-pool tensors
this PR glm5-next blk.N.indexer.kpool_{gate,ape}
ggml-org#27754, ggml-org#27752 glm5next blk.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 existing LLM_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-GGUF UD-IQ1_S, shard 1 rewritten to glm5-next in 0.338 s, both data shards left byte for byte as uploaded and still containing blk.N.indexer_compressor_*:

print_info: arch                  = glm5-next
load_tensors: offloaded 47/47 layers to GPU
load_tensors:        CUDA0 model buffer size = 85766.72 MiB
[ Prompt: 53.2 t/s | Generation: 61.7 t/s ]

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_APE is registered GGML_OP_GET_ROWS while LLM_TENSOR_INDEXER_KPOOL_APE is registered GGML_OP_ADD. Yours is the correct one, since the tensor feeds ggml_add. That field only feeds select_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.

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
danielhanchen force-pushed the glm5next/naming-aliases branch from 00a0bab to b4eb203 Compare August 28, 2026 08:17
@danielhanchen danielhanchen changed the title glm5-next: accept the alternative arch and tensor spellings glm5-next: fall back to the deepseek4 spelling for the k-pool tensors Aug 28, 2026
@github-actions github-actions Bot added the model label Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant