Skip to content

[BUG] #4753 (fix of #4736) incomplete on ROCm: AWQ format=GEMV_FAST / LLM_AWQ cannot be quantized by any backend (AUTO, AWQ_TORCH, AWQ_GEMV_TRITON all refuse), while rocm-rdna4.md lists them as AUTO-quantizable #5109

Closed

Description

@Qubitium

Found on main @ 7b8f127, AMD Radeon AI PRO R9700 (gfx1201, ROCm 10.1, torch 2.16 dev).

What is wrong

#4753 (the fix for #4736) gave FORMAT.GEMV_FAST and FORMAT.LLM_AWQ a portable in-session reader (AwqGEMVFastTorchLinear, LLMAwqTorchLinear). #4736 reported that the failure also happens on ROCm, but the fix only covers CUDA and CPU-only hosts. On ROCm, every backend still refuses to pack these formats, so an AWQ format="gemv_fast" or format="llm-awq" checkpoint cannot be produced at all:

quantize(..., backend=...) on ROCm Result
AUTO (default) ValueError: AwqGEMVFastLinear does not support device: DEVICE.ROCM (... select a portable *Torch or *Triton backend for this quantization method instead)
BACKEND.AWQ_TORCH ValueError: AwqGEMVFastTorchLinear does not support device: DEVICE.ROCM (AwqGEMVFastTorchLinear only supports cpu ...)
BACKEND.AWQ_GEMV_TRITON ValueError: Unsupported backend: BACKEND.AWQ_GEMV_TRITON for METHOD.AWQ with format FORMAT.GEMV_FAST

LLM_AWQ fails the same way (LLMAwqLinear is CUDA-only). The failure is raised up front in select_quant_linear (gptqmodel/utils/importer.py:1714, from models/base.py:2599), so no calibration is lost. However:

  1. The docs say it works. The docs/rocm-rdna4.md backend table has the row "AWQ FORMAT.GEMV / GEMV_FAST / LLM_AWQ" with "❌ native / ✅ AWQ_GEMV_TRITON (AUTO quantize, explicit load)" for gfx1200, gfx1201 and gfx1250. AWQ_GEMV_TRITON only handles FORMAT.GEMV. docs/quantization-guide.md ("FORMAT.GEMV_FAST and FORMAT.LLM_AWQ follow the same rule") also does not mention that ROCm has no path.
  2. The AUTO error points to a fix that does not exist. It tells the user to "select a portable *Torch or *Triton backend". The only Torch reader is declared CPU-only, and there is no Triton kernel for this layout.

AwqGEMVFastTorchLinear and LLMAwqTorchLinear are pure Torch. They dequantize the interleaved words in FP32, and the kernel compile matrix lists them at INDUCTOR. Nothing in them is CPU-specific, apart from SUPPORTS_DEVICES = [DEVICE.CPU].

Repro (ROCm, Qwen2.5-0.5B-Instruct truncated to 2 layers, 32 C4 texts)

import torch
from gptqmodel import GPTQModel, CalibrationConfig
from gptqmodel.quantization import FORMAT
from gptqmodel.quantization.config import AWQConfig
for be in (None, "awq_torch", "awq_gemv_triton"):
    m = GPTQModel.load("Qwen/Qwen2.5-0.5B-Instruct", AWQConfig(bits=4, group_size=128, format=FORMAT.GEMV_FAST), dtype=torch.float16)
    try:
        m.quantize(CalibrationConfig(dataset=calib), **({"backend": be} if be else {}))
    except ValueError as e:
        print(be, "->", e)

Output:

None -> <class '...gemv_fast_awq.AwqGEMVFastLinear'> does not support device: DEVICE.ROCM (AwqGEMVFastLinear is CUDA-only and does not run on ROCm; select a portable `*Torch` or `*Triton` backend for this quantization method instead)
awq_torch -> <class '...gemv_fast_awq.AwqGEMVFastTorchLinear'> does not support device: DEVICE.ROCM (AwqGEMVFastTorchLinear only supports `cpu` and does not run on ROCm; select a backend that declares ROCm support for this quantization method instead)
awq_gemv_triton -> Unsupported backend: `BACKEND.AWQ_GEMV_TRITON` for `METHOD.AWQ` with format `FORMAT.GEMV_FAST`

For comparison, FORMAT.GEMV on the same host quantizes, saves and reloads correctly (in-session AwqGEMVTorchLinear, NLL 12.701 on the probe text, the same as FORMAT.GEMM).

Suggested fix

Pick one:

Test that should have caught it

tests/test_awq_gemv_fast.py and tests/test_awq_llm_awq.py in the ROCm run. #4753 only added CPU coverage.

Severity

Medium. A documented format/platform combination is unusable on ROCm, and the error message sends the user to a backend that also refuses. It fails fast, so no compute is lost.

🤖 Generated with Claude Code

Activity

  1. ZX-ModelCloud commented on Nov 18, 2026

    @ZX-ModelCloud
    Collaborator

    Agent claim released: agent-1e00052575aa finished this issue.

    Pull request: #5176

    Verifying ROCm AWQ GEMV_FAST/LLM_AWQ support gap on latest main in a dedicated worktree

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions