summaryrefslogtreecommitdiff
path: root/candle-core/src/quantized/k_quants.rs
diff options
context:
space:
mode:
Diffstat (limited to 'candle-core/src/quantized/k_quants.rs')
-rw-r--r--candle-core/src/quantized/k_quants.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/candle-core/src/quantized/k_quants.rs b/candle-core/src/quantized/k_quants.rs
index 7f14600b..e7404529 100644
--- a/candle-core/src/quantized/k_quants.rs
+++ b/candle-core/src/quantized/k_quants.rs
@@ -671,7 +671,11 @@ impl GgmlType for BlockQ2K {
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 = "avx")]
+ return super::avx::vec_dot_q2k_q8k(n, xs, ys);
+
if n % QK_K != 0 {
crate::bail!("vec_dot_q2k_q8k: {n} is not divisible by {QK_K}")
}
@@ -834,7 +838,11 @@ impl GgmlType for BlockQ3K {
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 = "avx")]
+ return super::avx::vec_dot_q3k_q8k(n, xs, ys);
+
if n % QK_K != 0 {
crate::bail!("vec_dot_q3k_q8k: {n} is not divisible by {QK_K}")
}
@@ -1288,7 +1296,11 @@ impl GgmlType for BlockQ5K {
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 = "avx")]
+ return super::avx::vec_dot_q5k_q8k(n, xs, ys);
+
if n % QK_K != 0 {
crate::bail!("vec_dot_q5k_q8k: {n} is not divisible by {QK_K}")
}