From 7db967e811024e75b4ce75fc50976944500d2d27 Mon Sep 17 00:00:00 2001 From: Iwan Kawrakow Date: Mon, 8 Jan 2024 12:12:00 +0100 Subject: [PATCH] Fix bug in qequantize_row_iq2_xxs The 0.25f factor was missing. Great detective work by @ggerganov! --- ggml-quants.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ggml-quants.c b/ggml-quants.c index 24e39c73f..80c339b1f 100644 --- a/ggml-quants.c +++ b/ggml-quants.c @@ -2442,7 +2442,7 @@ void dequantize_row_iq2_xxs(const block_iq2_xxs * restrict x, float * restrict y for (int ib32 = 0; ib32 < QK_K/32; ++ib32) { memcpy(aux32, x[i].qs + 4*ib32, 2*sizeof(uint32_t)); - const float db = d * (0.5f + (aux32[1] >> 28)); + const float db = d * (0.5f + (aux32[1] >> 28)) * 0.25f; for (int l = 0; l < 4; ++l) { const uint8_t * grid = (const uint8_t *)(iq2xxs_grid + aux8[l]); const uint8_t signs = ksigns_iq2xs[(aux32[1] >> 7*l) & 127];