From c36ba69bda2602a75aeee70f201987e10c2dd238 Mon Sep 17 00:00:00 2001 From: Lucas Wilkinson Date: Thu, 15 Jan 2026 11:19:12 -0700 Subject: [PATCH] [BugFix] Fix `assert x_s.shape[-1] == x_q.shape[-1] // group_shape[1]` in Blackwell Quantized MoE Test (#32362) Signed-off-by: Lucas Wilkinson Signed-off-by: Lucas Wilkinson Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- vllm/model_executor/layers/quantization/utils/quant_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vllm/model_executor/layers/quantization/utils/quant_utils.py b/vllm/model_executor/layers/quantization/utils/quant_utils.py index c27ce349425..48beb977cdb 100644 --- a/vllm/model_executor/layers/quantization/utils/quant_utils.py +++ b/vllm/model_executor/layers/quantization/utils/quant_utils.py @@ -247,8 +247,8 @@ def scaled_dequantize( if group_shape is not None: group_shape = _normalize_quant_group_shape(x_q, group_shape) - if x_s.ndim == 0: # scalar - x_s = x_s.unsqueeze(-1).unsqueeze(-1) # convert to (1, 1) tensor + if x_s.numel() == 1: # scalar + x_s = x_s.reshape(1, 1) # normalize all scalar-like tensors to (1, 1) if x_s.ndim == 1: if group_shape is None: raise AssertionError(