[Bugfix][Quantization][XPU] Fix moe_wna16 linear weight loading (#52651)

Signed-off-by: Artur Fierka <artur.fierka@intel.com>
This commit is contained in:
Artur Fierka
2026-09-07 20:20:17 +08:00
committed by GitHub
parent 4a806d08ee
commit 5e6f6a8ed4
3 changed files with 65 additions and 6 deletions
@@ -182,16 +182,21 @@ class MoeWNA16Config(QuantizationConfig):
AutoGPTQConfig,
)
linear_config: QuantizationConfig
if self.linear_quant_method == "gptq":
return AutoGPTQConfig.from_config(self.full_config).get_quant_method(
layer, prefix
)
linear_config = AutoGPTQConfig.from_config(self.full_config)
elif self.linear_quant_method in ("awq", "awq_marlin"):
return AutoAWQConfig.from_config(self.full_config).get_quant_method(
layer, prefix
)
linear_config = AutoAWQConfig.from_config(self.full_config)
else:
raise ValueError("moe_wna16 only support gptq and awq.")
# The delegate is rebuilt from the raw HF quantization dict, which
# lists shard names and never fused ones. Without the mapping it
# resolves fused layers (qkv_proj, gate_up_proj) to
# UnquantizedLinearMethod and the checkpoint's qweight has nowhere
# to load.
linear_config.packed_modules_mapping = self.packed_modules_mapping
return linear_config.get_quant_method(layer, prefix)
elif isinstance(layer, RoutedExperts):
return MoeWNA16Method(self, layer.moe_config)
return None