[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:
@@ -932,13 +932,12 @@ ALL_DECODER_LAYER_TYPES = {
|
||||
class Qwen3_5ForCausalLM(nn.Module):
|
||||
"""Qwen3.5 Model with support for dense variant."""
|
||||
|
||||
if _is_gfx95 or _is_npu:
|
||||
packed_modules_mapping = {
|
||||
"qkv_proj": ["q_proj", "k_proj", "v_proj"],
|
||||
"gate_up_proj": ["gate_proj", "up_proj"],
|
||||
"in_proj_qkvz": ["in_proj_qkv", "in_proj_z"],
|
||||
"in_proj_ba": ["in_proj_b", "in_proj_a"],
|
||||
}
|
||||
packed_modules_mapping = {
|
||||
"qkv_proj": ["q_proj", "k_proj", "v_proj"],
|
||||
"gate_up_proj": ["gate_proj", "up_proj"],
|
||||
"in_proj_qkvz": ["in_proj_qkv", "in_proj_z"],
|
||||
"in_proj_ba": ["in_proj_b", "in_proj_a"],
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@@ -1377,9 +1376,9 @@ class Qwen3_5MoeForCausalLM(Qwen3_5ForCausalLM):
|
||||
|
||||
|
||||
class Qwen3_5ForConditionalGeneration(Qwen3VLForConditionalGeneration):
|
||||
if _is_gfx95 or _is_npu:
|
||||
packed_modules_mapping = Qwen3_5ForCausalLM.packed_modules_mapping
|
||||
hf_to_sglang_mapper = None
|
||||
|
||||
packed_modules_mapping = Qwen3_5ForCausalLM.packed_modules_mapping
|
||||
hf_to_sglang_mapper = None
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@@ -1524,9 +1523,8 @@ class Qwen3_5ForConditionalGeneration(Qwen3VLForConditionalGeneration):
|
||||
class Qwen3_5MoeForConditionalGeneration(Qwen3VLForConditionalGeneration):
|
||||
"""Qwen3.5 MoE Vision-Language Model."""
|
||||
|
||||
if _is_gfx95 or _is_npu:
|
||||
packed_modules_mapping = Qwen3_5ForCausalLM.packed_modules_mapping
|
||||
hf_to_sglang_mapper = None
|
||||
packed_modules_mapping = Qwen3_5ForCausalLM.packed_modules_mapping
|
||||
hf_to_sglang_mapper = None
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user