[Fix] NVFP4 qwen3.5 quant error fix by add packed_modules_mapping (#23471)

Co-authored-by: 百麒 <yaozhong.lyz@alibaba-inc.com>
This commit is contained in:
Lewis
2026-04-28 13:36:09 -07:00
committed by GitHub
co-authored by 百麒
parent 914ef7c7f3
commit 9814cc89ce
+11 -13
View File
@@ -932,13 +932,12 @@ ALL_DECODER_LAYER_TYPES = {
class Qwen3_5ForCausalLM(nn.Module): class Qwen3_5ForCausalLM(nn.Module):
"""Qwen3.5 Model with support for dense variant.""" """Qwen3.5 Model with support for dense variant."""
if _is_gfx95 or _is_npu: packed_modules_mapping = {
packed_modules_mapping = { "qkv_proj": ["q_proj", "k_proj", "v_proj"],
"qkv_proj": ["q_proj", "k_proj", "v_proj"], "gate_up_proj": ["gate_proj", "up_proj"],
"gate_up_proj": ["gate_proj", "up_proj"], "in_proj_qkvz": ["in_proj_qkv", "in_proj_z"],
"in_proj_qkvz": ["in_proj_qkv", "in_proj_z"], "in_proj_ba": ["in_proj_b", "in_proj_a"],
"in_proj_ba": ["in_proj_b", "in_proj_a"], }
}
def __init__( def __init__(
self, self,
@@ -1377,9 +1376,9 @@ class Qwen3_5MoeForCausalLM(Qwen3_5ForCausalLM):
class Qwen3_5ForConditionalGeneration(Qwen3VLForConditionalGeneration): class Qwen3_5ForConditionalGeneration(Qwen3VLForConditionalGeneration):
if _is_gfx95 or _is_npu:
packed_modules_mapping = Qwen3_5ForCausalLM.packed_modules_mapping packed_modules_mapping = Qwen3_5ForCausalLM.packed_modules_mapping
hf_to_sglang_mapper = None hf_to_sglang_mapper = None
def __init__( def __init__(
self, self,
@@ -1524,9 +1523,8 @@ class Qwen3_5ForConditionalGeneration(Qwen3VLForConditionalGeneration):
class Qwen3_5MoeForConditionalGeneration(Qwen3VLForConditionalGeneration): class Qwen3_5MoeForConditionalGeneration(Qwen3VLForConditionalGeneration):
"""Qwen3.5 MoE Vision-Language Model.""" """Qwen3.5 MoE Vision-Language Model."""
if _is_gfx95 or _is_npu: packed_modules_mapping = Qwen3_5ForCausalLM.packed_modules_mapping
packed_modules_mapping = Qwen3_5ForCausalLM.packed_modules_mapping hf_to_sglang_mapper = None
hf_to_sglang_mapper = None
def __init__( def __init__(
self, self,