Neon optimized version of the q4k vecdot product. (#632)

This commit is contained in:
Laurent Mazare
2023-08-27 21:30:47 +01:00
committed by GitHub
parent 24dda44c27
commit 1da71a5da1
2 changed files with 99 additions and 1 deletions

View File

@ -1102,7 +1102,11 @@ impl GgmlType for BlockQ4K {
const BLCK_SIZE: usize = QK_K;
type VecDotType = BlockQ8K;
#[allow(unreachable_code)]
fn vec_dot(n: usize, xs: &[Self], ys: &[Self::VecDotType]) -> Result<f32> {
#[cfg(target_feature = "neon")]
return super::neon::vec_dot_q4k_q8k(n, xs, ys);
if n % QK_K != 0 {
crate::bail!("vec_dot_q4k_q8k: {n} is not divisible by {QK_K}")
}