[JIT] Restore the previous division behavior in per-token group quantization (#32616)

Co-authored-by: hjzhang <zhanghjzzz@qq.com>
This commit is contained in:
hjzhang
2026-07-28 17:56:36 +08:00
committed by GitHub
co-authored by hjzhang
parent 2b6e01c673
commit dde03d7c4a
@@ -305,7 +305,7 @@ struct QuantTrait {
} else { } else {
// fp32 scale: multiply in fp32 (hmul2 brings too much precision loss) // fp32 scale: multiply in fp32 (hmul2 brings too much precision loss)
scale_inv = raw_scale; scale_inv = raw_scale;
const float quant_scale = kMaxValue * __frcp_rn(amax); const float quant_scale = kMaxValue / amax;
const float2 quant_scale2 = {quant_scale, quant_scale}; const float2 quant_scale2 = {quant_scale, quant_scale};
#pragma unroll #pragma unroll
for (uint32_t i = 0; i < kVecSize / 2; ++i) { for (uint32_t i = 0; i < kVecSize / 2; ++i) {