You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Regression from #4379 fix: re-saving a checkpoint that contains a tensor with no matching module crashes (e.g. TheBloke/Llama-2-7B-GPTQ self_attn.rotary_emb.inv_freq) #4452
Severity: medium. Kind: regression from 2daaae4 (#4379). Confirmed at 489aed6 on an RTX 4090.
GPTQModel.load("TheBloke/Llama-2-7B-GPTQ", device="cuda:0").save("out")
# AttributeError: LlamaAttention has no attribute 'rotary_emb' (from writer.get_model_with_quantize)
Cause: the dtype-preservation code (gptqmodel/utils/model.py:3319) runs model.get_submodule(module_name) for every checkpoint key. It has no guard for keys whose module no longer exists in the current transformers modeling code, such as the per-layer inv_freq buffers in older Llama checkpoints. Keys like that should be skipped (they are dropped on load anyway), not raise.
Found during an AI-assisted review (Claude Code, round 13) of 489aed6; repros were run at that commit (A/B against def6e61 where noted) on RTX 4090/5090 (CUDA 13) and/or Radeon AI PRO R9700 (ROCm) unless marked static/suspected.
Activity
fix(load): load quantized-module buffers at their checkpoint dtype (M…