From d63b54922fdc71755aebb8f1c7b8d3cda00933f7 Mon Sep 17 00:00:00 2001 From: Matthias Gehre Date: Mon, 23 Feb 2026 14:14:59 -0700 Subject: [PATCH] [ROCm][Refactor] Enable GPTQMarlinConfig on ROCm to use choose_mp_linear_kernel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On ROCm, GPTQ models were forced through the legacy GPTQConfig → GPTQLinearMethod → ops.gptq_gemm path, bypassing the choose_mp_linear_kernel framework entirely. This meant any new kernel added to the MPLinearKernel registry (Conch, future kernels) would never be used for GPTQ models on ROCm. This change allows GPTQMarlinConfig to be selected on ROCm by using is_cuda_alike() instead of is_cuda() in the compatibility check, and skips the NVIDIA device_capability gate in query_marlin_supported_quant_types on ROCm (since ROCm device capabilities do not map to NVIDIA compute capability semantics). Also fixes ConchLinearKernel to handle symmetric quantization (no zero points) by clearing the raw packed qzeros attribute on the layer, so _get_weight_params returns None for w_zp. Without this fix, the unprocessed packed qzeros tensor was passed to the Conch Triton kernel, causing an illegal memory access. Before this change, GPTQ on ROCm used ops.gptq_gemm (ExLlama v2) directly. After this change, choose_mp_linear_kernel selects ConchLinearKernel by default. ExllamaLinearKernel (same ops.gptq_gemm kernel as before) can be used via VLLM_DISABLED_KERNELS=ConchLinearKernel. Benchmarked on AMD Strix Halo (gfx1151, LPDDR5X-8000 128 GB): Model: TheBloke/Llama-2-7B-Chat-GPTQ input-len=128, output-len=128, num-prompts=5: ConchLinearKernel (default): Median TTFT: 112 ms Median TPOT: 90.50 ms ExllamaLinearKernel: Median TTFT: 168 ms Median TPOT: 19.24 ms Accuracy (lm_eval gsm8k, 200 samples, ExllamaLinearKernel): TheBloke/Llama-2-7B-Chat-GPTQ: 0.135 → 0.140 (no regression) Signed-off-by: Matthias Gehre --- vllm/model_executor/layers/quantization/gptq_marlin.py | 2 +- vllm/model_executor/layers/quantization/utils/marlin_utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vllm/model_executor/layers/quantization/gptq_marlin.py b/vllm/model_executor/layers/quantization/gptq_marlin.py index d7b2a366e1f0..631d19d34be4 100644 --- a/vllm/model_executor/layers/quantization/gptq_marlin.py +++ b/vllm/model_executor/layers/quantization/gptq_marlin.py @@ -276,7 +276,7 @@ def is_gptq_marlin_compatible(cls, quant_config: dict[str, Any]): sym = quant_config.get("sym") desc_act = quant_config.get("desc_act") - if not (current_platform.is_cuda() or current_platform.is_cpu()): + if not (current_platform.is_cuda_alike() or current_platform.is_cpu()): return False if quant_method != "gptq": diff --git a/vllm/model_executor/layers/quantization/utils/marlin_utils.py b/vllm/model_executor/layers/quantization/utils/marlin_utils.py index d659effd70ff..54bf2a2c36e5 100644 --- a/vllm/model_executor/layers/quantization/utils/marlin_utils.py +++ b/vllm/model_executor/layers/quantization/utils/marlin_utils.py @@ -46,7 +46,7 @@ def query_marlin_supported_quant_types( if current_platform.is_cpu(): return _query_cpu_marlin_supported_quant_types(has_zp, include_fp_type) - if not current_platform.is_rocm(): + if current_platform.is_cuda(): if device_capability is None: capability_tuple = current_platform.get_device_capability() device_capability = (