Skip to content

Commit 26650b8

Browse files
ggerganovhodlen
authored andcommitted
ggml : fix unnecessary f32 -> f16 -> f32 casts (mmla) (ggml-org#5951)
1 parent c746cee commit 26650b8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ggml-quants.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4059,10 +4059,10 @@ void ggml_vec_dot_q4_1_q8_1(int n, float * restrict s, size_t bs, const void * r
40594059
const int8x16_t y1_h = vld1q_s8(b_y1->qs + 16);
40604060

40614061
// mmla into int32x4_t
4062-
float32x4_t scale = {GGML_FP16_TO_FP32(b_x0->d)*GGML_FP16_TO_FP32(b_y0->d),
4063-
GGML_FP16_TO_FP32(b_x0->d)*GGML_FP16_TO_FP32(b_y1->d),
4064-
GGML_FP16_TO_FP32(b_x1->d)*GGML_FP16_TO_FP32(b_y0->d),
4065-
GGML_FP16_TO_FP32(b_x1->d)*GGML_FP16_TO_FP32(b_y1->d)};
4062+
float32x4_t scale = {GGML_FP16_TO_FP32(b_x0->d)*b_y0->d,
4063+
GGML_FP16_TO_FP32(b_x0->d)*b_y1->d,
4064+
GGML_FP16_TO_FP32(b_x1->d)*b_y0->d,
4065+
GGML_FP16_TO_FP32(b_x1->d)*b_y1->d};
40664066

40674067
int8x16_t l0 = vreinterpretq_s8_s64(vzip1q_s64(vreinterpretq_s64_s8(x0_l), vreinterpretq_s64_s8(x1_l)));
40684068
int8x16_t l1 = vreinterpretq_s8_s64(vzip2q_s64(vreinterpretq_s64_s8(x0_l), vreinterpretq_s64_s8(x1_l)));

0 commit comments

Comments
 (0)