Skip to content

Load glm-dsa indexer tensors as optional (ggml-org/llama.cpp#24770) - #2017

Merged
ikawrakow merged 1 commit into
ikawrakow:mainfrom
sayap:glm-5.2-optional-indexer
Jun 24, 2026
Merged

Load glm-dsa indexer tensors as optional (ggml-org/llama.cpp#24770)#2017
ikawrakow merged 1 commit into
ikawrakow:mainfrom
sayap:glm-5.2-optional-indexer

Conversation

@sayap

@sayap sayap commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

This allows normal quants of GLM-5.2 to load. Meanwhile, unsloth quants can actually load without this, as those have indexer tensors duplicated to all layers.

// The DSA indexer runtime is not implemented (graph is plain MLA), so these
// tensors are loaded-but-unused. Mark them optional so layers without an
// indexer load as nullptr (ported from ggml-org/llama.cpp#24770).
layer.indexer_k_norm = create_tensor(ctx_split, tn(LLM_TENSOR_INDEXER_K_NORM, "weight", i), {hparams.indexer_head_size}, flags | llama_model_loader::TENSOR_NOT_REQUIRED);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Theoretically we could also skip them.

int skip_flags = flags | llama_model_loader::TENSOR_NOT_REQUIRED | llama_model_loader::TENSOR_SKIP;
layer.indexer_k_norm_b = create_tensor(ctx_split, tn(LLM_TENSOR_INDEXER_K_NORM,   "bias",   i), {hparams.indexer_head_size}, skip_flags);
etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants