aup-learning-cloud icon indicating copy to clipboard operation
aup-learning-cloud copied to clipboard

[Bug] GPTQ Quantization fails with Cholesky error on ROCm 7.11.0 (gfx1151) using llmcompressor

Open youyoulyz opened this issue 7 months ago • 4 comments

Description

I am attempting to quantize the Qwen/Qwen3-0.6B model to 4-bit using llmcompressor on an AMD gfx1151+7.11.0 system. While the calibration data preparation completes successfully, the process fails during the GPTQ quantization stage when calling torch.linalg.cholesky.

The error log indicates a requirement for MAGMA, which in the context of ROCm/HIP, usually points to a missing or incompatible linear algebra backend (rocSOLVER/hipSOLVER) for the specific hardware/software combination.

Environment

  • GPU/APU: AMD gfx1151 (Strix Point / Ryzen AI 9)
  • ROCm Version: 7.11.0 (Same as development)
  • OS: Linux-24.04.3
  • Library: llmcompressor
  • Model: Qwen/Qwen3-0.6B

Error Traceback

2026-04-26T10:40:21.573317+0000 | compress_module_list | INFO - Quantizing model.layers.0.self_attn.q_proj using 2048.0 samples
...
RuntimeError: Calling torch.linalg.cholesky on a CUDA tensor requires compiling PyTorch with MAGMA. Please use PyTorch built with MAGMA support.

Reproducible Code

from transformers import AutoTokenizer, AutoModelForCausalLM
from datasets import load_dataset, Dataset
from llmcompressor import oneshot
from llmcompressor.modifiers.quantization import GPTQModifier
import torch

def quantize_with_llm_compressor(model_id: str, output_dir: str):
    tokenizer = AutoTokenizer.from_pretrained(model_id)
    model = AutoModelForCausalLM.from_pretrained(
        model_id, device_map="auto", torch_dtype=torch.float16
    )

    raw_dataset = load_dataset("allenai/c4", "en", split="train", streaming=True)
    # ... (Data collection logic) ...
    
    recipe = GPTQModifier(targets="Linear", scheme="W4A16", ignore=["lm_head"])

    oneshot(
        model=model,
        dataset=final_dataset,
        recipe=recipe,
        max_seq_length=1024,
        num_calibration_samples=2048,
    )

quantize_with_llm_compressor("Qwen/Qwen3-0.6B", "Qwen3-0.6B-COMPRESSED-4bit")

Suggested Direction

According to recent ROCm updates, I suspect this may be related to how llmcompressor triggers linear algebra routines on the newer gfx1151 architecture. Does the current version of the library support ROCm 7.11.0+395?

Are there specific environment variables (e.g., HSA_OVERRIDE_GFX_VERSION) or additional ROCm math libraries (rocSOLVER) that need to be explicitly configured to enable Cholesky support for this hardware?

youyoulyz avatar Apr 26 '26 11:04 youyoulyz

@youyoulyz The auplc-base image move on to ROCm 7.12.0 now, does this issue still happen under this version?

kerwtsai-amd avatar Apr 28 '26 04:04 kerwtsai-amd

@KerwinTsaiii https://github.com/AMDResearch/aup-learning-cloud/blob/main/dockerfiles/Base/Dockerfile.rocm Hi I am trying to use rocm 7.12.0 but I find here is still 7.11.0. Should I change the version manually to 7.12.0. I am not sure if 7.12.0 is verified.

youyoulyz avatar Apr 29 '26 14:04 youyoulyz

@MioYuuIH Please help to verify this

kerwtsai-amd avatar May 05 '26 12:05 kerwtsai-amd

@KerwinTsaiii @MioYuuIH Verified 7.12.0 solves this problem. Suggesting upgrade rocm to 7.12.0 in base image.

youyoulyz avatar May 09 '26 00:05 youyoulyz