Skip to content

Commit 88a231e

Browse files
committed
Optimize ggml_vec_dot_q8_q8 for ppc
This patch avoids redundant vec_spalt for delta Signed-off-by: Shalini Salomi Bodapati <[email protected]>
1 parent 19e899c commit 88a231e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ggml/src/ggml-cpu/ggml-cpu-quants.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3929,9 +3929,8 @@ void ggml_vec_dot_q8_0_q8_0(int n, float * GGML_RESTRICT s, size_t bs, const voi
39293929
__builtin_prefetch(x[ib].qs, 0, 1);
39303930
__builtin_prefetch(y[ib].qs, 0, 1);
39313931

3932-
vector float vxd = vec_splats(GGML_FP16_TO_FP32(x[ib].d));
3933-
vector float vyd = vec_splats(GGML_FP16_TO_FP32(y[ib].d));
3934-
vector float vd = vec_mul(vxd, vyd);
3932+
float delta = GGML_FP16_TO_FP32(x[ib].d) * GGML_FP16_TO_FP32(y[ib].d);
3933+
vector float vd = vec_splats(delta);
39353934

39363935
vector signed char q8x0 = vec_xl( 0, x[ib].qs);
39373936
vector signed char q8x1 = vec_xl(16, x[ib].qs);

0 commit comments

Comments
 (0)