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] In-session use after quantize() is still broken for FP8/GGUF with offload (embed_tokens/norm/lm_head left on meta) and for AWQ/QQQ/GGUF (CUDA-only kernels picked on CPU) (incomplete fix of #4203) #4381
Severity: medium (default config). Status: confirmed on an RTX 4090 at def6e61. Kind: incomplete fix of #4203 (46ae741). The GPTQ case is #4380.
1. Weight-only methods (FP8, GGUF) with offload_to_disk=True leave base modules on meta
Where:gptqmodel/looper/weight_only_looper.py:974-984 and gptqmodel/utils/offload.py:112-125.
Weight-only methods load the model as a lazy meta shell, so embed_tokens, norm and rotary_emb are already on meta before offload happens.
capture_offloaded_base_modules skips modules that are already on meta. With instrumentation it returns [], so nothing is restored and the strict check never fires.
fromgptqmodelimportGPTQModel, QuantizeConfigm=GPTQModel.load("Qwen/Qwen3-0.6B", quantize_config=QuantizeConfig(method="fp8")) # or method="gguf", bits=4, format="q_k_m"m.quantize(["x"]); print(m.model.device) # metam.generate("Hello, my name is", max_new_tokens=8)
Actual:
A string prompt fails with Tensor.item() cannot be called on meta tensors.
CPU or CUDA ids fail with Tensor on device meta is not on the expected device.
These are the original #4203 errors. With offload_to_disk=False, FP8 in-session generation works.
2. AWQ, QQQ and GGUF pick CUDA-only kernels on CPU after quantize()
This is the follow-up comment on #4203, and it still reproduces with either offload setting (3-layer Qwen3-0.6B).
AWQ gemm:Could not run 'gptqmodel_awq::gemm_forward' ... 'CPU' backend.
QQQ: the same error, from qqq_gemm.
GGUF q_k_m: with offload off, GGUFTritonKernel only supports CUDA/ROCm inference. With offload on it fails earlier, on meta (item 1).
Expected
The same as GPTQ: the model is usable in-session, with base modules restored and kernels picked for the device the model actually lives on. Otherwise, a clear error telling the user to reload the saved checkpoint.
Found during an AI-assisted review (Claude Code, round 12) of def6e61; repros were run at that commit (A/B against 842d666 where noted) on RTX 4090/5090 (CUDA 13) and/or Radeon AI PRO R9700 (ROCm) unless marked static/suspected.
Taking this. I'll investigate against current main, add a targeted regression test, and open a PR. Will report back here if the claim turns out to be invalid or already fixed.
Fix in #4426: materialize weight-only base modules after quantization and re-home AWQ/QQQ/GGUF modules onto a kernel that supports the final (CPU) device, or raise the reload-the-checkpoint error.
Activity
Qubitium commentedon Nov 16, 2026
Taking this. I'll investigate against current
main, add a targeted regression test, and open a PR. Will report back here if the claim turns out to be invalid or already fixed.Qubitium commentedon Nov 16, 2026
Fix in #4426: materialize weight-only base modules after quantization and re-home AWQ/QQQ/GGUF modules onto a kernel that supports the final (CPU) device, or raise the reload-the-checkpoint error.
fix: restore base modules and re-pick CPU kernels after weight-only q…
fix: restore base modules and re-pick CPU kernels after weight-only q…