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] FP8 checkpoints cannot be LoRA-fine-tuned with PEFT: TorchFP8Linear is SUPPORTS_TRAINING/AUTO_TRAINABLE but has no qweight, so peft's dispatch_gptq raises AttributeError #4948
Found on main @ 3867c82, CPU (Qwen2.5-0.5B-Instruct FP8Config() checkpoint made on this commit), peft 0.21.2.
What is wrong
TorchFP8Linear declares SUPPORTS_TRAINING = True (gptqmodel/nn_modules/qlinear/fp8.py:230). BACKEND.AUTO_TRAINABLE therefore selects it, BaseQModel.train() accepts it, and its backward is correct (input gradients flow). Its message for inference-only kernels tells users to reload with backend="auto_trainable" "before fine-tuning". But the standard fine-tuning path, PEFT LoRA, cannot wrap it.
PEFT routes every GPT-QModel BaseQuantLinear through peft/tuners/lora/gptq.py::dispatch_gptq, which runs target.qweight = target_base_layer.qweight. TorchFP8Linear keeps its codes in weight and has no qweight, so get_peft_model raises AttributeError before any training starts.
The other trainable kernels I checked attach and train correctly with PEFT on this commit: GPTQ Torch/TorchFused/AVX512/Aten, AWQ Torch/AVX512, GGUF Torch, Paro. Their LoRA gradients agree with a dense dequantized reference to within bf16 noise (max relative diff 0.19-0.33 vs. a 0.20 self-reference floor; GGUF fp32 0.0), and an adapter saved from one kernel reloads on another. FP8 is the only advertised trainable kernel that cannot be used.
TorchFP8Linear True False
input grad True
AttributeError: 'TorchFP8Linear' object has no attribute 'qweight'
File ".../peft/tuners/lora/gptq.py", line 131, in dispatch_gptq
target.qweight = target_base_layer.qweight
Suggested fix
Either expose the packed tensor under the name PEFT expects (for example a read-only qweight property on TorchFP8Linear that returns self.weight), or set SUPPORTS_TRAINING = False / have AUTO_TRAINABLE refuse FP8 with a clear message, and state the supported methods in docs/peft.md (it lists only gptq_torch and torch_awq).
Test that should have caught it
No test runs get_peft_model on an FP8 (or GGUF/Paro) model. Add a parametrized PEFT smoke test over every kernel with SUPPORTS_TRAINING = True: wrap with LoRA, one backward, non-None LoRA grads.
Severity
Low-medium. FP8 checkpoints cannot be LoRA-fine-tuned through the documented PEFT route, even though the kernel is flagged trainable and GPT-QModel's own error message recommends exactly this flow. The failure is loud.
Agent release:agent-root-4948 finished this issue. Fix: #4987, squash-merged as 6feac8a.
TorchFP8Linear now exposes the packed FP32 weight as a qweight property with a setter (over weight), which is the exact attribute PEFT's dispatch_gptq writes (target.qweight = target_base_layer.qweight, where target is the FP8 module), so a read-only property was not enough. New tests/test_fp8_peft_lora_4948.py covers the alias contract plus real PEFT LoRA wrapping; red on unmodified main (3 failed, AttributeError: ... has no attribute 'qweight'), green here (3 passed with peft 0.21.2).
Activity
Qubitium commentedon Nov 17, 2026
Agent claim:
agent-root-4948is working on this issue now.Qubitium commentedon Nov 17, 2026
Agent release:
agent-root-4948finished this issue. Fix: #4987, squash-merged as 6feac8a.TorchFP8Linearnow exposes the packed FP32 weight as aqweightproperty with a setter (overweight), which is the exact attribute PEFT'sdispatch_gptqwrites (target.qweight = target_base_layer.qweight, wheretargetis the FP8 module), so a read-only property was not enough. Newtests/test_fp8_peft_lora_4948.pycovers the alias contract plus real PEFT LoRA wrapping; red on unmodifiedmain(3 failed,AttributeError: ... has no attribute 'qweight'), green here (3 passed with peft 0.21.2).fix(fp8): expose the packed weight as `qweight` so PEFT LoRA can wrap…