[NPU] bugs fix for Deepseek models (#19544)

This commit is contained in:
Michelle Wu
2026-02-28 17:26:15 +08:00
committed by GitHub
parent 1eb40d8d45
commit b7f13a7b73
2 changed files with 12 additions and 11 deletions
@@ -459,8 +459,9 @@ class NPUFusedMLAPreprocess(torch.nn.Module):
# assert self.quant_config and self.quant_config.get_name() == "modelslim"
# route by `qkv_a_proj` quant type as MTP layers can be unquantized
_is_w8a8 = (
hasattr(self.qkv_a_proj.quant_method, "quant_config")
and self.qkv_a_proj.quant_method.quant_config.get_name() == "modelslim"
hasattr(self.qkv_a_proj.quant_method, "quantization_config")
and self.qkv_a_proj.quant_method.quantization_config.get_name()
== "modelslim"
)
# with the mlaprolog enabled, the kv_b_proj layers are unquantized
_is_mlaprolog = hasattr(self.quant_config, "ignore") and any(