Skip to content

Commit 1be4514

Browse files
committed
wip: vec_round_from_fp32 seem to be throwing rounding errors
Signed-off-by: Aaron Teo <aaron.teo1@ibm.com>
1 parent dc29eed commit 1be4514

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3140,10 +3140,10 @@ void ggml_cpu_fp32_to_fp16(const float * x, ggml_fp16_t * y, int64_t n) {
31403140

31413141
#if defined(__NNPA__)
31423142
for (; i + 7 < n; i += 8) {
3143-
uint16_t tmp[8];
3143+
int16_t tmp[8];
31443144
float32x4_t v_x1 = vec_xl(0, x + i + 0);
31453145
float32x4_t v_x2 = vec_xl(0, x + i + 4);
3146-
uint16x8_t v_dlf16 = vec_round_from_fp32(v_x1, v_x2, 0);
3146+
int16x8_t v_dlf16 = vec_round_from_fp32(v_x1, v_x2, 0);
31473147
vec_xst(v_dlf16, 0, tmp);
31483148
raise(SIGINT);
31493149
}

0 commit comments

Comments
 (0)