mirror of
https://github.com/ikawrakow/ik_llama.cpp.git
synced 2026-02-25 15:44:10 +00:00
Fix iqk_mul_mat on AVX512 systems that are missing BF16 support (#204)
* Fix iqk_mul_mat on AVX512 systems that are missing BF16 support * One more --------- Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
@@ -16079,7 +16082,7 @@ inline void iqk_flash_helper_T(KHelper& kh, ggml_type type_v,
|
||||
HelperF16<Dv, k_step> vh(v, stride_v);
|
||||
iqk_flash_helper<Dk, Dv, k_step>(kh, vh, nq1, nk1, stride_q, stride_m, stride_qkv, q, mask, scale, softcap, qkv);
|
||||
} break;
|
||||
#ifdef HAVE_FANCY_SIMD
|
||||
#ifdef __AVX512BF16__
|
||||
case GGML_TYPE_BF16: {
|
||||
HelperBF16<Dv, k_step> vh(v, stride_v);
|
||||
iqk_flash_helper<Dk, Dv, k_step>(kh, vh, nq1, nk1, stride_q, stride_m, stride_qkv, q, mask, scale, softcap, qkv);
|
||||
|
||||
Reference in New Issue
Block a user