summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIwan Kawrakow <iwan.kawrakow@gmail.com>2024-08-09 17:29:32 +0300
committerKawrakow <48489457+ikawrakow@users.noreply.github.com>2024-08-09 16:31:04 +0200
commitf5d1af61d79fb53ccfbac2e665e43208c07b083d (patch)
tree1929f5b878ba6d6a1132f1054984a14144436bba
parentf0d7a0d53b0ecdd43ba85bcd49309b291372ca67 (diff)
Fix Makefile
I always use cmake, so had forgotten to pay attention to the Makefile.
-rw-r--r--Makefile23
-rw-r--r--ggml/src/iqk/iqk_quantize.cpp6
2 files changed, 27 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 8d2ccddc..f77da312 100644
--- a/Makefile
+++ b/Makefile
@@ -248,7 +248,7 @@ endif
# keep standard at C11 and C++11
MK_CPPFLAGS = -Iggml/include -Iggml/src -Iinclude -Isrc -Icommon
MK_CFLAGS = -std=c11 -fPIC
-MK_CXXFLAGS = -std=c++11 -fPIC
+MK_CXXFLAGS = -std=c++17 -fPIC
MK_NVCCFLAGS = -std=c++11
ifdef LLAMA_NO_CCACHE
@@ -560,6 +560,12 @@ ifdef GGML_NVPL
OBJ_GGML += ggml/src/ggml-blas.o
endif # GGML_NVPL
+OBJ_GGML += ggml/src/iqk/iqk_quantize.o
+ifndef GGML_NO_IQKMULMAT
+ MK_CPPFLAGS += -DGGML_USE_IQK_MULMAT
+ OBJ_GGML += ggml/src/iqk/iqk_mul_mat.o
+endif
+
ifndef GGML_NO_LLAMAFILE
MK_CPPFLAGS += -DGGML_USE_LLAMAFILE
OBJ_GGML += ggml/src/llamafile/sgemm.o
@@ -1019,6 +1025,21 @@ ggml/src/ggml-blas.o: \
ggml/include/ggml-blas.h
$(CXX) $(CXXFLAGS) -c $< -o $@
+ggml/src/iqk/iqk_quantize.o: \
+ ggml/src/iqk/iqk_quantize.cpp \
+ ggml/src/iqk/iqk_quantize.h \
+ ggml/src/ggml-quants.h ggml/src/ggml-common.h ggml/include/ggml.h ggml/src/ggml-impl.h
+ $(CXX) $(CXXFLAGS) -c $< -o $@
+
+ifndef GGML_NO_IQKMULMAT
+ggml/src/iqk/iqk_mul_mat.o: \
+ ggml/src/iqk/iqk_mul_mat.cpp \
+ ggml/src/iqk/iqk_mul_mat.h \
+ ggml/src/iqk/iqk_quantize.h \
+ ggml/src/ggml-quants.h ggml/src/ggml-common.h ggml/include/ggml.h ggml/src/ggml-impl.h
+ $(CXX) $(CXXFLAGS) -c $< -o $@
+endif # GGML_NO_IQKMULMAT
+
ifndef GGML_NO_LLAMAFILE
ggml/src/llamafile/sgemm.o: \
ggml/src/llamafile/sgemm.cpp \
diff --git a/ggml/src/iqk/iqk_quantize.cpp b/ggml/src/iqk/iqk_quantize.cpp
index e43ed999..730de8c9 100644
--- a/ggml/src/iqk/iqk_quantize.cpp
+++ b/ggml/src/iqk/iqk_quantize.cpp
@@ -42,9 +42,13 @@ struct IQ1BNQuantizer {
}
return max_in_row;
}
- static constexpr uint8_t k_mult[5] = {81, 27, 9, 3, 1};
+ // The Makefile has issues dwaling with this?
+ //static constexpr uint8_t k_mult[5] = {81, 27, 9, 3, 1};
+ static const uint8_t k_mult[5];
};
+const uint8_t IQ1BNQuantizer::k_mult[5] = {81, 27, 9, 3, 1};
+
void IQ1BNQuantizer::quantize_one_row_1bn(const float * src, block_iq1_bn * y, int n_per_row, const float * imatrix) {
static const int k_nb[6] = {1, 3, 9, 27, 81, 243};