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] #4554 incomplete: AWQ format=GEMV_FAST / LLM_AWQ quantize() still always raises at the end (no CPU in-session reader; #4599 fixed only GEMV), calibration lost; 2 repo tests red #4736
Found on main @ b225a43, RTX 4090 (CUDA 13.2, torch 2.15). The same happens on ROCm R9700, where the CUDA AWQ extension is not available. #4554 was fixed only for FORMAT.GEMV (fd8d524, #4599); FORMAT.GEMV_FAST and FORMAT.LLM_AWQ still raise.
What is wrong
At the end of quantize(), rehome_quantized_kernel() (gptqmodel/models/base.py:~631-698) moves the packed AWQ layers to a kernel that runs on the final device (cpu). #4599 added AwqGEMVTorchLinear as the CPU in-session reader for FORMAT.GEMV. There is still no CPU reader for the GEMV_FAST and LLM_AWQ layouts, so for those formats:
RuntimeError: Quantize: quantized layers use kernels that cannot run on the final device `cpu` (AwqGEMVFastLinear). The in-session model cannot run inference; save the quantized model and reload the saved checkpoint on this device (or use the portable Torch backend) before using it.
The whole calibration is lost and nothing is saved. The message tells the user to save, but quantize() raised before save() could be called. This is the same failure #4554 described for GEMV.
Repo tests that fail on main (CUDA, and ROCm via the same path)
tests/test_awq_gemv_fast.py::test_awq_gemv_fast_quantized_model_loads_and_generates: ValueError: No valid quant linear -> RuntimeError (above)
tests/test_awq_llm_awq.py::test_llm_awq_checkpoint_loads_with_gemv_fast_backend_and_generates: same error, with LLMAwqLinear
Minimal repro
Qwen2.5-0.5B-Instruct truncated to 2 layers, 16 C4 samples:
gemv_fast RAISED RuntimeError Quantize: quantized layers use kernels that cannot run on the final device `cpu` (AwqGEMVFastLinear). ...
llm-awq RAISED RuntimeError Quantize: quantized layers use kernels that cannot run on the final device `cpu` (LLMAwqLinear). ...
gemv OK AwqGEMVTorchLinear
gemm OK AwqTorchLinear
Suggested fix
Do what #4599 did for GEMV: give GEMV_FAST and LLM_AWQ (the same interleaved layout family) a Torch/CPU in-session reader. Alternatively, make rehome_quantized_kernel() non-fatal when no in-session kernel exists: leave the modules un-rehomed, warn, and allow save(), as #4554 suggested. In either case, quantize() must not throw away a finished calibration.
Test that should have caught it
The two repo tests above. They have been red since the #4426 rehome, and #4599 ran only the GEMV variant.
Severity
High for users of format="gemv_fast" / "llm-awq": the documented quantize -> save flow cannot complete on any device.
Two more repo tests hit this. Both are in the long tests/test_checkpoint_method_compatibility.py file (about 30 min, so they time out in a 600 s CI slot):
RuntimeError: Quantize: quantized layers use kernels that cannot run on the final device `cpu` (AwqGEMVFastLinear). The in-session model cannot run inference; save the quantized model and re...
Activity
n-o-t-mugen commentedon Nov 17, 2026
hey! i could take this up
fix(awq): give FORMAT.GEMV_FAST and LLM_AWQ a CPU in-session reader (#…
test(kernels): classify the CPU readers and pin their compile level (#…
Qubitium commentedon Nov 17, 2026
Two more repo tests hit this. Both are in the long
tests/test_checkpoint_method_compatibility.pyfile (about 30 min, so they time out in a 600 s CI slot):test_format_checkpoint_recovery[awq-gemv_fast]test_eora_format_checkpoint_recovery[awq-gemv_fast](Seen on
main@ b225a43, RTX 4090.)🤖 Generated with Claude Code
fix(export): load MLX exports on CPU so GEMV checkpoints export on GP…