llama.cpp crash: missing tensor 'blk.40.attn_norm.weight' (Incorrect GGUF Metadata)

#1
by freykun - opened

Hi, thanks for providing these quants!

I ran into an issue where loading the GGUF files from this repository in llama.cpp (and standard backends like Ollama/LM Studio) causes a crash on load:

E llama_model_load: error loading model: missing tensor 'blk.40.attn_norm.weight'
The Cause
The quantization script used to generate these files seems to have exported the incorrect metadata for the layer count. The model metadata claims qwen35moe.block_count: 41 and qwen35moe.nextn_predict_layers: 1 (presumably due to the MTP layers). However, the actual tensors for layer 41 (blk.40) and the MTP projection (blk.39.nextn.eh_proj.weight) were not included in the GGUF file. When llama.cpp tries to load them, it hits a missing tensor error and crashes.

Temporary Workaround for Users
For anyone else running into this, you can bypass the crash by forcing llama.cpp to ignore the broken metadata and expect the standard 40 blocks with no MTP layers using the --override-kv flag:

bash
llama-server -m Qwen.Qwen-AgentWorld-35B-A3B.f16.gguf.Q4_K_M.gguf --override-kv "qwen35moe.block_count=int:40,qwen35moe.nextn_predict_layers=int:0"

To the uploader: A re-quantization with the latest convert_hf_to_gguf.py script that either correctly exports the MTP tensors, or correctly strips them out and sets the metadata to 40 blocks, should permanently fix this for all users.

DevQuasar org

@freykun
GGUFs have been patched -> you don't need that hack

DevQuasar org

final fix

csabakecskemeti changed discussion status to closed

Sign up or log in to comment