ggml : fix Q4_1 quantization

This commit is contained in:
Georgi Gerganov 2023-05-07 18:07:11 +03:00
parent 4991499a5a
commit c216656990
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735

4
ggml.c
View File

@ -826,8 +826,8 @@ static void quantize_row_q4_1_reference(const float * restrict x, block_q4_1 * r
y[i].m = min;
for (int l = 0; l < qk/2; ++l) {
const float x0 = (x[0 + l] - min)*id;
const float x1 = (x[qk/2 + l] - min)*id;
const float x0 = (x[i*qk + 0 + l] - min)*id;
const float x1 = (x[i*qk + qk/2 + l] - min)*id;
const uint8_t xi0 = MIN(15, (int8_t)(x0 + 0.5f));
const uint8_t xi1 = MIN(15, (int8_t)(x1 + 0.5f));