Skip to content

Commit 46fc696

Browse files
committed
ggml : fix bug - using wrong block type
1 parent 6e0f0b6 commit 46fc696

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ggml.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -1836,7 +1836,7 @@ static const quantize_fns_t quantize_fns[GGML_TYPE_COUNT] = {
18361836
.dequantize_row_q = dequantize_row_q4_0,
18371837
.quantize_row_q = quantize_row_q4_0,
18381838
.quantize_row_q_reference = (quantize_row_q_t) quantize_row_q4_0_reference,
1839-
.quantize_row_q_dot = quantize_row_q8_1,
1839+
.quantize_row_q_dot = quantize_row_q8_0,
18401840
.vec_dot_q = ggml_vec_dot_q4_0_q8_0,
18411841
},
18421842
[GGML_TYPE_Q4_1] = {
@@ -1850,7 +1850,7 @@ static const quantize_fns_t quantize_fns[GGML_TYPE_COUNT] = {
18501850
.dequantize_row_q = dequantize_row_q4_2,
18511851
.quantize_row_q = quantize_row_q4_2,
18521852
.quantize_row_q_reference = (quantize_row_q_t) quantize_row_q4_2_reference,
1853-
.quantize_row_q_dot = quantize_row_q8_1,
1853+
.quantize_row_q_dot = quantize_row_q8_0,
18541854
.vec_dot_q = ggml_vec_dot_q4_2_q8_0,
18551855
},
18561856
[GGML_TYPE_Q4_3] = {
@@ -2482,7 +2482,7 @@ static void ggml_vec_dot_q4_0_q8_0(const int n, float * restrict s, const void *
24822482
assert(nb % 2 == 0);
24832483

24842484
const block_q4_0 * restrict x = vx;
2485-
const block_q8_1 * restrict y = vy;
2485+
const block_q8_0 * restrict y = vy;
24862486

24872487
#if defined(__ARM_NEON)
24882488
float32x4_t sumv0 = vdupq_n_f32(0.0f);
@@ -2491,8 +2491,8 @@ static void ggml_vec_dot_q4_0_q8_0(const int n, float * restrict s, const void *
24912491
for (int i = 0; i < nb; i += 2) {
24922492
const block_q4_0 * restrict x0 = &x[i + 0];
24932493
const block_q4_0 * restrict x1 = &x[i + 1];
2494-
const block_q8_1 * restrict y0 = &y[i + 0];
2495-
const block_q8_1 * restrict y1 = &y[i + 1];
2494+
const block_q8_0 * restrict y0 = &y[i + 0];
2495+
const block_q8_0 * restrict y1 = &y[i + 1];
24962496

24972497
const uint8x16_t m4b = vdupq_n_u8(0xf);
24982498
const int8x16_t s8b = vdupq_n_s8(0x8);
@@ -2786,7 +2786,7 @@ static void ggml_vec_dot_q4_2_q8_0(const int n, float * restrict s, const void *
27862786
assert(QK8_1 == 2*QK4_2);
27872787

27882788
const block_q4_2 * restrict x = vx;
2789-
const block_q8_1 * restrict y = vy;
2789+
const block_q8_0 * restrict y = vy;
27902790

27912791
#if defined(__ARM_NEON)
27922792
float32x4_t sumv0 = vdupq_n_f32(0.0f);
@@ -2798,8 +2798,8 @@ static void ggml_vec_dot_q4_2_q8_0(const int n, float * restrict s, const void *
27982798
const block_q4_2 * restrict x1_0 = &x[2*(i + 1) + 0];
27992799
const block_q4_2 * restrict x1_1 = &x[2*(i + 1) + 1];
28002800

2801-
const block_q8_1 * restrict y0 = &y[i + 0];
2802-
const block_q8_1 * restrict y1 = &y[i + 1];
2801+
const block_q8_0 * restrict y0 = &y[i + 0];
2802+
const block_q8_0 * restrict y1 = &y[i + 1];
28032803

28042804
const uint8x16_t m4b = vdupq_n_u8(0xf);
28052805
const int8x16_t s8b = vdupq_n_s8(0x8);

0 commit comments

Comments
 (0)