aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSebastianApel <13675545+SebastianApel@users.noreply.github.com>2023-04-13 14:46:23 +0200
committerGitHub <noreply@github.com>2023-04-13 15:46:23 +0300
commit95ea26f6e92d620a5437f576b80868aee7f808d6 (patch)
tree9256b919bf5939cbc18a91a6975f453f0fcb45a5 /Makefile
parent82d146df9b43cf677e0dbce20b03cf864958a0cc (diff)
benchmark : add tool for timing q4_0 matrix multiplication (#653)
* Initial version of q4_0 matrix multiplication benchmark * Bugfix: Added dependency to ggml.o to benchmark * Reviewer requests: added parameter for threads, switched to ggml_time_us() * Reviewer input: removed rtsc, use epsilon for check * Review comment: Removed set_locale * Feature: Param for numer of iterations, Bugfix for use of parameter threads * Reviewer suggestion: Moved to examples * Reviewer feedback: Updated clean: and benchmark: sections --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 3e58a28..fe2f26e 100644
--- a/Makefile
+++ b/Makefile
@@ -149,7 +149,7 @@ common.o: examples/common.cpp examples/common.h
$(CXX) $(CXXFLAGS) -c examples/common.cpp -o common.o
clean:
- rm -vf *.o main quantize quantize-stats perplexity embedding
+ rm -vf *.o main quantize quantize-stats perplexity embedding benchmark-q4_0-matmult
main: examples/main/main.cpp ggml.o llama.o common.o
$(CXX) $(CXXFLAGS) examples/main/main.cpp ggml.o llama.o common.o -o main $(LDFLAGS)
@@ -171,10 +171,15 @@ embedding: examples/embedding/embedding.cpp ggml.o llama.o common.o
libllama.so: llama.o ggml.o
$(CXX) $(CXXFLAGS) -shared -fPIC -o libllama.so llama.o ggml.o $(LDFLAGS)
+
#
# Tests
#
+benchmark: ggml.o
+ $(CXX) $(CXXFLAGS) examples/benchmark/benchmark-q4_0-matmult.c ggml.o -o benchmark-q4_0-matmult $(LDFLAGS)
+ ./benchmark-q4_0-matmult
+
.PHONY: tests
tests:
bash ./tests/run-tests.sh