Skip to content

model : glm-dsa load DSA indexer tensors as optional#24770

Merged
ggerganov merged 1 commit into
ggml-org:masterfrom
davidrhodus:glm-dsa-optional-indexer
Jun 20, 2026
Merged

model : glm-dsa load DSA indexer tensors as optional#24770
ggerganov merged 1 commit into
ggml-org:masterfrom
davidrhodus:glm-dsa-optional-indexer

Conversation

@davidrhodus

@davidrhodus davidrhodus commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Overview

Loading any GLM-5.2 GGUF (GlmMoeDsaForCausalLM / GLM_DSA) fails with missing tensor 'blk.3.indexer.k_norm.weight'. GLM-5.2 ships the DSA lightning indexer on only a subset of layers, but llama_model_glm_dsa::load_arch_tensors created the five indexer_* tensors on every layer as required.

GLM_DSA uses llama_model_deepseek2::graph (plain MLA) and never references the indexer tensors (the DSA indexer runtime isn't implemented yet), so they are loaded-but-unused. Marking them TENSOR_NOT_REQUIRED lets layers without an indexer load as nullptr; the model runs as full MLA attention. DeepSeek-V3.2 (uniform indexer on every layer) is unaffected.

Additional information

Complements the conversion support in #19460. Verified by loading and generating from a GLM-5.2 GGUF on Metal (previously failed at load).

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES. Full disclosure: this change was developed with an AI agent (Claude Code) under my direction — it diagnosed the missing-tensor failure, wrote the five-line TENSOR_NOT_REQUIRED change, and drafted this description; verified by building and running a GLM-5.2 GGUF. Given the project's policy on predominantly-AI-generated PRs, I leave it to the maintainers whether this qualifies as acceptable assistive use or should be reworked/declined.

@davidrhodus davidrhodus requested a review from CISC as a code owner June 18, 2026 16:43
@github-actions github-actions Bot added the model Model specific label Jun 18, 2026
@ggml-gh-bot

This comment was marked as resolved.

@CISC CISC left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the OP to comply with our contributing guidelines please.

Comment thread src/models/glm-dsa.cpp Outdated
GLM-5.2 ships the DSA "lightning indexer" on only a subset of layers (the
"full" layers; others omit it), but the GLM_DSA loader created the five
indexer tensors on every layer as required, so loading any GLM-5.2 GGUF
failed with e.g. `missing tensor 'blk.3.indexer.k_norm.weight'`.

GLM_DSA's graph is llama_model_deepseek2::graph (plain MLA) and does not use
the indexer tensors (indexer runtime not yet implemented), so they are
loaded-but-unused. Marking them TENSOR_NOT_REQUIRED lets layers without an
indexer load as nullptr and the model runs as full MLA attention.

DeepSeek-V3.2 (uniform indexer on all layers) is unaffected.
@davidrhodus davidrhodus force-pushed the glm-dsa-optional-indexer branch from 46891f5 to 03f0da8 Compare June 18, 2026 23:39
@davidrhodus davidrhodus changed the title model: glm-dsa: load DSA indexer tensors as optional (fixes GLM-5.2 loading) model : glm-dsa load DSA indexer tensors as optional Jun 18, 2026
@davidrhodus

Copy link
Copy Markdown
Contributor Author

Thanks for the review! Applied:

  • Reverted the comment to // DSA indexer (rationale kept in the commit message).
  • Reformatted the title to model : <title> per the contributing guidelines.

@CISC

CISC commented Jun 19, 2026

Copy link
Copy Markdown
Member

Thanks for the review! Applied:

  • Reverted the comment to // DSA indexer (rationale kept in the commit message).
  • Reformatted the title to model : <title> per the contributing guidelines.

Please use our Pull Request Template in your OP.

@davidrhodus

Copy link
Copy Markdown
Contributor Author

Updated the OP to use the PR template, with the AI-usage disclosure filled in.

@CISC

CISC commented Jun 19, 2026

Copy link
Copy Markdown
Member

Updated the OP to use the PR template, with the AI-usage disclosure filled in.

Thank you.

@CISC CISC added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Jun 19, 2026
@ggerganov ggerganov merged commit 796f41b into ggml-org:master Jun 20, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. model Model specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants