[Bugfix][Quantization] Fix dynamic INT8 W8A8 MoE config being built as W8A16 (#50833)
Signed-off-by: Hank <hcc.mayday@gmail.com> Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
Hank_ committed
Aug 7, 2026 at 16:21 UTC
b8db7f4abd2c864d5a7045b6d36fa36c2c7bb1e1
1 file changed
+5
-4
vllm/model_executor/layers/fused_moe/oracle/int8.py
+5
-4
@@ -183,9 +183,10 @@ def make_int8_moe_quant_config(
183
per_act_token_quant: bool = False,
184
layer: torch.nn.Module | None = None,
185
) -> FusedMoEQuantConfig:
186
- assert (a1_scale is None and a2_scale is None) or (
187
- a1_scale is not None and a2_scale is not None
188
- ), "a1_scale and a2_scale must both be provided or both be None"
186
+ if (a1_scale is None) != (a2_scale is None):
187
+ raise ValueError("a1_scale and a2_scale must both be provided or both be None")
188
+
189
+ scales_absent = a1_scale is None and a2_scale is None
190
191
if int8_backend == Int8MoeBackend.HUMMING:
192
from vllm.model_executor.layers.fused_moe import RoutedExperts
@@ -196,7 +197,7 @@ def make_int8_moe_quant_config(
197
assert isinstance(layer, RoutedExperts)
198
return get_humming_moe_quant_config(layer)
199
199
- if a1_scale is None or a2_scale is None:
200
+ if scales_absent and not per_act_token_quant:
201
return int8_w8a16_moe_quant_config(
202
w1_scale=w1_scale,
203
w2_scale=w2_scale,