Skip to content

[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

Closed

Description

@Qubitium

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.
from gptqmodel import GPTQModel, QuantizeConfig
m = 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)        # meta
m.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.

Activity

  1. added
    bug
    on Nov 16, 2026
  2. Qubitium commented on Nov 16, 2026

    @Qubitium
    CollaboratorAuthor

    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.

  3. self-assigned this
    on Nov 16, 2026
  4. Qubitium commented on Nov 16, 2026

    @Qubitium
    CollaboratorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions