Skip to content

Commit f84a37b

Browse files
committed
llamafile: rework fp16 loading
Signed-off-by: Aaron Teo <[email protected]>
1 parent 9121ea2 commit f84a37b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ggml/src/ggml-cpu/llamafile/sgemm.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,13 @@ template <> inline float32x4_t load(const ggml_fp16_t *p) {
250250

251251
#if defined(__VXE__) || defined(__VXE2__)
252252
template <> inline float32x4_t load(const ggml_fp16_t * p) {
253-
return vec_xl(0, p);
253+
float tmp[4];
254+
255+
for (int i = 0; i < 4; i++) {
256+
tmp[i] = GGML_FP16_TO_FP32(x[i]);
257+
}
258+
259+
return vec_xl(0, (const float *)(tmp));
254260
}
255261
template <> inline float32x4_t load(const float * p) {
256262
return vec_xl(0, p);

0 commit comments

Comments
 (0)