Repository navigation
Description
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:
- The docs say it works. The
docs/rocm-rdna4.mdbackend table has the row "AWQFORMAT.GEMV/GEMV_FAST/LLM_AWQ" with "❌ native / ✅AWQ_GEMV_TRITON(AUTO quantize, explicit load)" for gfx1200, gfx1201 and gfx1250.AWQ_GEMV_TRITONonly handlesFORMAT.GEMV.docs/quantization-guide.md("FORMAT.GEMV_FASTandFORMAT.LLM_AWQfollow the same rule") also does not mention that ROCm has no path. - The AUTO error points to a fix that does not exist. It tells the user to "select a portable
*Torchor*Tritonbackend". 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:
- Let the Torch readers run on GPUs (
SUPPORTS_DEVICES+= CUDA/ROCm) and haveawq_gemv_pack_backendresolve GEMV_FAST/LLM_AWQ on ROCm toAWQ_TORCH, which mirrors what fix(awq): portable CPU GEMV reader so quantize() completes in session (#4554) #4599/fix(awq): give FORMAT.GEMV_FAST and LLM_AWQ a CPU in-session reader (#4736) #4753 did for CPU hosts. A reload would then need an explicitBACKEND.AWQ_TORCH, the same as GEMV withAWQ_GEMV_TRITON. - Or state in
rocm-rdna4.mdand the quantization guide that GEMV_FAST/LLM_AWQ cannot be quantized on ROCm, and change the AUTO error so it points toFORMAT.GEMMorFORMAT.GEMVinstead of a nonexistent portable backend.
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
ZX-ModelCloud commentedon Nov 18, 2026
Agent claim released:
agent-1e00052575aafinished this issue.Pull request: #5176
Verifying ROCm AWQ GEMV_FAST/LLM_AWQ support gap on latest main in a dedicated worktree
fix(awq): pack GEMV_FAST/LLM_AWQ with the portable reader on ROCm (#5109
fix(awq): pack GEMV_FAST/LLM_AWQ with the portable reader on ROCm (Mo…