From 86808719c41fa64f577f512d10f7d8360fe3b48e Mon Sep 17 00:00:00 2001 From: Iwan Kawrakow Date: Wed, 12 Feb 2025 10:15:22 +0200 Subject: [PATCH] Fix iqk_mul_mat on AVX512 systems that are missing BF16 support --- ggml/src/iqk/iqk_mul_mat.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ggml/src/iqk/iqk_mul_mat.cpp b/ggml/src/iqk/iqk_mul_mat.cpp index 3b58495e..e23fa456 100644 --- a/ggml/src/iqk/iqk_mul_mat.cpp +++ b/ggml/src/iqk/iqk_mul_mat.cpp @@ -8082,6 +8082,9 @@ struct QFBase { using Acc = __m512; static inline Data load(const ggml_half * x) { return _mm512_cvtph_ps(_mm256_loadu_si256((const __m256i *)x)); } static inline Data load(const float * x) { return _mm512_loadu_ps(x); } + static inline Data load(const ggml_bf16_t * x) { + return _mm512_castsi512_ps(_mm512_slli_epi32(_mm512_cvtepu16_epi32(_mm256_loadu_si256((const __m256i*)x)), 16)); + } static inline Acc acc(Acc prev, const Data& y, const Data& x) { return _mm512_fmadd_ps(y, x, prev); }