llama : move the indexer key rotation choice into the model classes (#32653)

* llama : move the indexer key rotation choice into the model classes

The KV cache forced a Hadamard rotation for the lightning indexer keys
based on a list of architectures. The virtual llama_model::indexer_k_rot()
now returns true for the same models. DeepSeek4.1 inherits from DeepSeek4
but was not in the list, so it overrides it back to false.

* llama : rename indexer_k_rot() to lid_k_hdmd()
This commit is contained in:
Aman Gupta authored and GitHub committed 2026-11-20 18:49:16 +08:00
1 parent 6abcbe5d35
commit 4783b1145c
3 files changed
+11 -5

No files matched your search

+2 -5
View File
@@ -314,11 +314,8 @@ llama_kv_cache::llama_kv_cache(
ggml_is_quantized(type_k) &&
hparams.n_embd_head_k() % 64 == 0;
// always create Hadamard rotation tensors for DeepSeek lightning indexers
if ((model.arch == LLM_ARCH_DEEPSEEK32 || model.arch == LLM_ARCH_DEEPSEEK4 ||
model.arch == LLM_ARCH_GLM_DSA || model.arch == LLM_ARCH_DOTS3NOTE ||
model.arch == LLM_ARCH_MISTRAL_LARGE4) &&
hparams.n_embd_head_k_full == hparams.indexer_head_size) {
// always create Hadamard rotation tensors for lightning indexer keys
if (model.lid_k_hdmd() && hparams.n_embd_head_k_full == hparams.indexer_head_size) {
attn_rot_k = true;
}