From 2377dd8b97a4a648a9d02398957de008c924cfc2 Mon Sep 17 00:00:00 2001 From: NNN Date: Wed, 15 Jul 2026 23:02:51 +0900 Subject: [PATCH] fix: correct shard_ids for GDN in_proj_qkv under LoRA (Qwen3.5/3.6) When --enable-lora is set, qwen3_5.py loads the GDN block's in_proj_qkv weight via stacked_params_mapping with shard_id=(0, 1, 2) (a single tuple), since exllamav3 quantizes q+k+v as one fused trellis for this layer regardless of the LoRA-enabled / combined-in_proj_qkvz split. _shard_ids_for_layer() only special-cased the LoRA-disabled combined 'in_proj_qkvz' prefix. For the standalone 'in_proj_qkv' prefix used in the LoRA-enabled path, it fell through to the generic fallback and returned [0, 1, 2] (three separate integer shard ids), which never matches the tuple key (0, 1, 2) actually populated by the weight loader, causing: ValueError: Missing EXL3 tensors for ...in_proj_qkv: suh[0], suh[1], suh[2], svh[0], svh[1], svh[2], trellis[0], trellis[1], trellis[2] This adds the missing branch, mirroring the tuple-shard convention already used for the qkvz case. --- aphrodite/model_executor/layers/quantization/exl3.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aphrodite/model_executor/layers/quantization/exl3.py b/aphrodite/model_executor/layers/quantization/exl3.py index e4f4dc6d93..eb3da1b03a 100644 --- a/aphrodite/model_executor/layers/quantization/exl3.py +++ b/aphrodite/model_executor/layers/quantization/exl3.py @@ -955,6 +955,11 @@ def _shard_ids_for_layer( return [0, 1] if prefix.endswith("in_proj_qkvz"): return [(0, 1, 2), 3] + if prefix.endswith("in_proj_qkv"): + # LoRA-enabled GDN path (Qwen3.5/3.6): in_proj_qkv is loaded as a + # single fused (0, 1, 2) shard, matching qwen3_5.py's + # stacked_params_mapping for the enable_lora branch. + return [(0, 1, 2)] return list(range(len(output_partition_sizes)))