A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 13, 08:15 UTC
[XPU] add sym params to IPEXConfig (#28611)
Signed-off-by: Zhu, Zufang <zufang.zhu@intel.com>
zofia committed
Nov 13, 2025 at 19:35 UTC
c47b6c85ac25ecb0a26dfff76c70a0b1a9a4a6bf
1 file changed
+18
-2
vllm/model_executor/layers/quantization/ipex_quant.py
+18
-2
@@ -52,6 +52,7 @@ class IPEXConfig(QuantizationConfig):
52
modules_to_not_convert: list[str] | None = None,
53
desc_act: bool | None = None,
54
lm_head_quantized: bool | None = None,
55
+ is_sym: bool | None = None,
56
) -> None:
57
super().__init__()
58
self.method = method
@@ -60,6 +61,7 @@ class IPEXConfig(QuantizationConfig):
61
self.modules_to_not_convert = modules_to_not_convert or []
62
self.desc_act = desc_act
63
self.lm_head_quantized = lm_head_quantized
64
+ self.is_sym = is_sym
65
self.pack_factor = 32 // self.weight_bits
66
67
if self.weight_bits not in [4]:
@@ -108,15 +110,25 @@ class IPEXConfig(QuantizationConfig):
110
modules_to_not_convert = cls.get_from_keys_or(
111
config, ["modules_to_not_convert"], None
112
)
113
+ is_sym = not cls.get_from_keys_or(config, ["zero_point"], default=False)
114
return cls(
112
- method, weight_bits, group_size, modules_to_not_convert, False, False
115
+ method,
116
+ weight_bits,
117
+ group_size,
118
+ modules_to_not_convert,
119
+ False,
120
+ False,
121
+ is_sym,
122
)
123
# otherwise for gptq
124
weight_bits = cls.get_from_keys(config, ["bits"])
125
group_size = cls.get_from_keys(config, ["group_size"])
126
lm_head_quantized = cls.get_from_keys_or(config, ["lm_head"], default=False)
127
desc_act = cls.get_from_keys_or(config, ["desc_act"], default=False)
119
- return cls(method, weight_bits, group_size, [], desc_act, lm_head_quantized)
128
+ is_sym = cls.get_from_keys_or(config, ["sym"], default=True)
129
+ return cls(
130
+ method, weight_bits, group_size, [], desc_act, lm_head_quantized, is_sym
131
+ )
132
133
@classmethod
134
def override_quantization_method(
@@ -180,6 +192,7 @@ class IPEXGPTQLinearMethod(GPTQLinearMethod):
192
# The float activation will be quantized (dynamic, per-token) to INT8.
193
act_quant_mode = ipex.quantization.WoqActQuantMode.PER_BATCH_IC_BLOCK
194
195
+ assert isinstance(self.quant_config, IPEXConfig)
196
qconfig = ipex.quantization.get_weight_only_quant_qconfig_mapping(
197
weight_dtype=weight_dtype,
198
lowp_mode=lowp_mode,
@@ -200,6 +213,7 @@ class IPEXGPTQLinearMethod(GPTQLinearMethod):
213
bias=bias,
214
group_size=self.quant_config.group_size,
215
quant_method=IPEXConfig.IPEX_QUANT_METHOD_MAP["gptq"],
216
+ weight_qscheme="sym" if self.quant_config.is_sym else "asym",
217
)
218
)
219
@@ -250,6 +264,7 @@ class IPEXAWQLinearMethod(AWQLinearMethod):
264
# The float activation will be quantized (dynamic, per-token) to INT8.
265
act_quant_mode = ipex.quantization.WoqActQuantMode.PER_BATCH
266
267
+ assert isinstance(self.quant_config, IPEXConfig)
268
qconfig = ipex.quantization.get_weight_only_quant_qconfig_mapping(
269
weight_dtype=weight_dtype,
270
lowp_mode=lowp_mode,
@@ -269,6 +284,7 @@ class IPEXAWQLinearMethod(AWQLinearMethod):
284
bias=bias,
285
group_size=self.quant_config.group_size,
286
quant_method=IPEXConfig.IPEX_QUANT_METHOD_MAP["awq"], # type: ignore
287
+ weight_qscheme="sym" if self.quant_config.is_sym else "asym",
288
)
289
)
290