summaryrefslogtreecommitdiff
path: root/sgemm.cpp
diff options
context:
space:
mode:
authorIwan Kawrakow <iwan.kawrakow@gmail.com>2024-06-10 18:30:33 +0300
committerIwan Kawrakow <iwan.kawrakow@gmail.com>2024-06-22 12:02:50 +0300
commit9593e163db41f60b8d6598a443fec1740e97eb67 (patch)
treedd55925e2b5fc0960d77c5f8cc2c4d402118d9d0 /sgemm.cpp
parent81cf6990f512e82c2c89ba7f89a15c3d98172f84 (diff)
iqk_mul_mat: add ability to disable it
Diffstat (limited to 'sgemm.cpp')
-rw-r--r--sgemm.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/sgemm.cpp b/sgemm.cpp
index b6c00c4e..409a9a67 100644
--- a/sgemm.cpp
+++ b/sgemm.cpp
@@ -51,7 +51,9 @@
#include "sgemm.h"
#include "ggml-impl.h"
#include "ggml-quants.h"
+#if GGML_USE_IQK_MULMAT
#include "iqk_mul_mat.h"
+#endif
#ifdef _MSC_VER
#define NOINLINE __declspec(noinline)
@@ -866,8 +868,8 @@ bool llamafile_sgemm(int64_t m, int64_t n, int64_t k, const void *A, int64_t lda
if (Ctype != GGML_TYPE_F32)
return false;
+#if GGML_USE_IQK_MULMAT
#if defined __AVX2__ && defined __FMA__
- //bool is_accepted_float_type = k >= 32 && Atype == GGML_TYPE_F16 && Btype == GGML_TYPE_F32;
bool is_accepted_float_type = k >= 32 &&
((Atype == GGML_TYPE_F16 && Btype == GGML_TYPE_F32) || (Atype == GGML_TYPE_F32 && Btype == GGML_TYPE_F16));
#elif defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC && defined __ARM_FEATURE_FMA
@@ -884,22 +886,7 @@ bool llamafile_sgemm(int64_t m, int64_t n, int64_t k, const void *A, int64_t lda
return true;
}
}
-
-// if (task == GGML_TASK_TYPE_COMPUTE && k >= 32 && Atype == GGML_TYPE_F16) {
-//#if defined __AVX2__ && defined __FMA__
-// if (Btype == GGML_TYPE_F32) {
-// if (iqk_mul_mat(m, n, k, Atype, A, B, (float *)C, ldc, ith, nth)) {
-// return true;
-// }
-// }
-//#elif defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC && defined __ARM_FEATURE_FMA
-// if (Btype == GGML_TYPE_F16) {
-// if (iqk_mul_mat(m, n, k, Atype, A, B, (float *)C, ldc, ith, nth)) {
-// return true;
-// }
-// }
-//#endif
-// }
+#endif
switch (Atype) {