Skip to content

[BUG] AWQ format=GEMV on a bf16 model crashes when layer 0 is packed, after calibration has run: the GEMV kernels are fp16-only and nothing checks or casts up front #4394

Closed

Description

@Qubitium

Severity: low–medium. Status: confirmed on a Radeon AI PRO R9700 at def6e61. On CUDA it is likely the same, since AwqGEMVLinear.SUPPORTS_DTYPES=[fp16]. Kind: pre-existing; 842d666 fails the same way.

Where

  • nn_modules/qlinear/gemv_awq.py:79 and :364: SUPPORTS_DTYPES=[torch.float16].
  • looper/awq_processor.py:4470 → utils/model.py:826: create_quant_module raises here.

Repro

from gptqmodel import GPTQModel, FORMAT
from gptqmodel.quantization.config import AWQConfig
GPTQModel.load("Qwen/Qwen3-0.6B", quantize_config=AWQConfig(bits=4, group_size=128, format=FORMAT.GEMV)).quantize(calib)

Actual:

  • NotImplementedError: AwqGEMVTritonLinear only supports [torch.float16]: actual dtype = torch.bfloat16.
  • It is raised in layer-0 finalize, after the AWQ search has already run.

Expected: load the model in fp16 for GEMV, or reject the config at config/load time, before calibration.

Workaround: GPTQModel.load(..., dtype=torch.float16) works. ppl is 24.71 with AWQ_GEMV_TRITON, against 24.32 for GEMM.

Related (low, possibly by design)

On ROCm, loading a GEMV checkpoint with backend=AUTO raises NotImplementedError in models/loader.py:1379 (_reject_native_awq_gemv_on_rocm). This happens even though AWQ_GEMV_TRITON declares ROCm support and works when requested explicitly. AUTO could select it instead; #4107 only covered the quantize-side AUTO choice.


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

    Fixed in #4420: AWQ GEMV/GEMV_FAST/LLM_AWQ configs now reject a non-fp16 target dtype at load time (before calibration), with dtype=torch.float16 named as the fix.

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