[CPU] Add missing scalar fallback for CPU W4A8 INT4 GEMM (#44523)

Signed-off-by: wcy <233313160abc@gmail.com>
Co-authored-by: lyd1992 <liuyudong@iscas.ac.cn>
This commit is contained in:
wcy
2026-06-11 08:52:01 +00:00
committed by GitHub
co-authored by lyd1992
parent 1c3a72b8b2
commit f06aefb4e3
4 changed files with 61 additions and 15 deletions
+1 -1
View File
@@ -245,7 +245,7 @@ quantize_row_int8(uint8_t* __restrict__ Aq, float& As, const scalar_t* __restric
for (int64_t k = 0; k < K; ++k) {
const float val = static_cast<float>(A[k]) * inv_scale;
Aq[k] = (uint8_t)(std::round(val)) + 128;
Aq[k] = static_cast<uint8_t>(static_cast<int32_t>(std::round(val)) + 128);
}
As = scale;
}