transformers
0cd7bce4 - Fix Gemma2/3 GGUF rename rules + drop GGUF runtime-aux tensors

Commit
58 days ago
Fix Gemma2/3 GGUF rename rules + drop GGUF runtime-aux tensors Gemma-2 and Gemma-3 have four layer norms per block (input, post-attention, pre-feedforward, post-feedforward) but the converters shared `_NEMOTRON_CONVERTERS` which only handled two of them, and incorrectly mapped `ffn_norm` to `post_attention_layernorm`. Gemma-3 additionally has per-head q/k RMSNorm. Result: silent re-init of `pre_feedforward_layernorm`, `post_feedforward_layernorm`, `self_attn.{q,k}_norm` from defaults. Split into `_GEMMA2_CONVERTERS` and `_GEMMA3_CONVERTERS` with the correct four-norm mapping (plus q/k_norm for Gemma-3), all wrapped in `SubtractOne` since Gemma stores RMSNorm weights as `w + 1`. Also drop `rope_freqs.weight` at GGUF load: GGUF ships it as runtime metadata, but HF models compute RoPE frequencies from config — so it showed up as an "unexpected" key on Llama-3 etc. Add `tests/quantization/ggml/test_gguf_load_completeness.py` — slow test that loads one representative GGUF per registered model_type and asserts zero missing / unexpected / mismatched keys, so future rename regressions fail fast instead of silently re-initing parameters.
Author
Parents
Loading