From cd83a7d3621e11bc4aa189af166180272fb5f6e1 Mon Sep 17 00:00:00 2001 From: Iwan Kawrakow Date: Fri, 8 Mar 2024 13:38:45 +0200 Subject: [PATCH] iq1s_blocks16: Adjust scale fudge factor to 1.125 --- ggml-quants.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ggml-quants.c b/ggml-quants.c index cddbae8b3..79b418770 100644 --- a/ggml-quants.c +++ b/ggml-quants.c @@ -11635,7 +11635,7 @@ static void quantize_row_iq1_s_impl(const float * restrict x, void * restrict vy } float d = max_scale/31; - y[ibl].d = GGML_FP32_TO_FP16(d*1.085f); // 1.085f is another fudge factor. Don't ask me why it is needed. + y[ibl].d = GGML_FP32_TO_FP16(d*1.125f); // 1.085f is another fudge factor. Don't ask me why it is needed. float id = 1/d; for (int ib = 0; ib < QK_K/IQ1S_BLOCK_SIZE; ib += 2) { int l1 = nearest_int(0.5f*(id*scales[ib+0]-1));