Skip to content

Commit 9dae1dc

Browse files
committed
Revert "not working - refactoring"
This reverts commit f50c793, reversing changes made to c494525.
1 parent 0d729a1 commit 9dae1dc

32 files changed

+17273
-24359
lines changed

CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ find_package(Threads REQUIRED)
5959

6060
add_compile_definitions(LOG_DISABLE_LOGS)
6161
add_compile_definitions(GGML_USE_CPU)
62-
add_compile_definitions(GGML_USE_CPU_REPACK)
62+
add_compile_definitions(GGML_USE_CPU_AARCH64)
6363
add_compile_definitions(NOMINMAX)
6464

6565
if (MSVC)
@@ -375,14 +375,14 @@ add_library(ggml
375375
ggml/src/ggml-quants.h
376376
ggml/src/ggml-cpu/llamafile/sgemm.cpp
377377
ggml/src/ggml-cpu/llamafile/sgemm.h
378-
ggml/src/ggml-cpu/traits.cpp
379-
ggml/src/ggml-cpu/traits.h
378+
ggml/src/ggml-cpu/ggml-cpu-traits.cpp
379+
ggml/src/ggml-cpu/ggml-cpu-traits.h
380380
ggml/src/ggml-threading.cpp
381381
ggml/src/ggml-cpu/ggml-cpu.cpp
382-
ggml/src/ggml-cpu/repack.cpp
383-
ggml/src/ggml-cpu/repack.h
384-
ggml/src/ggml-cpu/quants.c
385-
ggml/src/ggml-cpu/quants.h
382+
ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp
383+
ggml/src/ggml-cpu/ggml-cpu-aarch64.h
384+
ggml/src/ggml-cpu/ggml-cpu-quants.c
385+
ggml/src/ggml-cpu/ggml-cpu-quants.h
386386
ggml/src/ggml-cpu/common.h
387387
ggml/src/ggml-cpu/binary-ops.h
388388
ggml/src/ggml-cpu/binary-ops.cpp

Makefile

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ ifdef KCPP_DEBUG
5151
CFLAGS = -g -O0
5252
CXXFLAGS = -g -O0
5353
endif
54-
CFLAGS += -I. -Iggml/include -Iggml/src -Iggml/src/ggml-cpu -Iinclude -Isrc -I./common -I./vendor -I./vendor/stb -I./include -I./include/CL -I./otherarch -I./otherarch/tools -I./otherarch/sdcpp -I./otherarch/sdcpp/thirdparty -I./include/vulkan -O3 -fno-finite-math-only -std=c11 -fPIC -DLOG_DISABLE_LOGS -D_GNU_SOURCE -DGGML_USE_CPU -DGGML_USE_CPU_REPACK
55-
CXXFLAGS += -I. -Iggml/include -Iggml/src -Iggml/src/ggml-cpu -Iinclude -Isrc -I./common -I./vendor -I./vendor/stb -I./include -I./include/CL -I./otherarch -I./otherarch/tools -I./otherarch/sdcpp -I./otherarch/sdcpp/thirdparty -I./include/vulkan -O3 -fno-finite-math-only -std=c++17 -fPIC -DLOG_DISABLE_LOGS -D_GNU_SOURCE -DGGML_USE_CPU -DGGML_USE_CPU_REPACK
54+
CFLAGS += -I. -Iggml/include -Iggml/src -Iggml/src/ggml-cpu -Iinclude -Isrc -I./common -I./vendor -I./vendor/stb -I./include -I./include/CL -I./otherarch -I./otherarch/tools -I./otherarch/sdcpp -I./otherarch/sdcpp/thirdparty -I./include/vulkan -O3 -fno-finite-math-only -std=c11 -fPIC -DLOG_DISABLE_LOGS -D_GNU_SOURCE -DGGML_USE_CPU -DGGML_USE_CPU_AARCH64
55+
CXXFLAGS += -I. -Iggml/include -Iggml/src -Iggml/src/ggml-cpu -Iinclude -Isrc -I./common -I./vendor -I./vendor/stb -I./include -I./include/CL -I./otherarch -I./otherarch/tools -I./otherarch/sdcpp -I./otherarch/sdcpp/thirdparty -I./include/vulkan -O3 -fno-finite-math-only -std=c++17 -fPIC -DLOG_DISABLE_LOGS -D_GNU_SOURCE -DGGML_USE_CPU -DGGML_USE_CPU_AARCH64
5656
ifndef KCPP_DEBUG
5757
CFLAGS += -DNDEBUG -s
5858
CXXFLAGS += -DNDEBUG -s
@@ -90,10 +90,10 @@ endif
9090
CUBLASLD_FLAGS =
9191
CUBLAS_OBJS =
9292

93-
OBJS_FULL += ggml-alloc.o ggml-cpu-traits.o ggml-quants.o ggml-cpu-quants.o ggml-cpu-repack.o unicode.o unicode-data.o ggml-threading.o ggml-cpu-cpp.o gguf.o sgemm.o common.o sampling.o kcpputils.o
94-
OBJS_SIMPLE += ggml-alloc.o ggml-cpu-traits.o ggml-quants_noavx2.o ggml-cpu-quants_noavx2.o ggml-cpu-repack_noavx2.o unicode.o unicode-data.o ggml-threading.o ggml-cpu-cpp.o gguf.o sgemm_noavx2.o common.o sampling.o kcpputils.o
95-
OBJS_SIMPLER += ggml-alloc.o ggml-cpu-traits.o ggml-quants_noavx1.o ggml-cpu-quants_noavx1.o ggml-cpu-repack_noavx1.o unicode.o unicode-data.o ggml-threading.o ggml-cpu-cpp.o gguf.o sgemm_noavx1.o common.o sampling.o kcpputils.o
96-
OBJS_FAILSAFE += ggml-alloc.o ggml-cpu-traits.o ggml-quants_failsafe.o ggml-cpu-quants_failsafe.o ggml-cpu-repack_failsafe.o unicode.o unicode-data.o ggml-threading.o ggml-cpu-cpp.o gguf.o sgemm_failsafe.o common.o sampling.o kcpputils.o
93+
OBJS_FULL += ggml-alloc.o ggml-cpu-traits.o ggml-quants.o ggml-cpu-quants.o ggml-cpu-aarch64.o unicode.o unicode-data.o ggml-threading.o ggml-cpu-cpp.o gguf.o sgemm.o common.o sampling.o kcpputils.o
94+
OBJS_SIMPLE += ggml-alloc.o ggml-cpu-traits.o ggml-quants_noavx2.o ggml-cpu-quants_noavx2.o ggml-cpu-aarch64_noavx2.o unicode.o unicode-data.o ggml-threading.o ggml-cpu-cpp.o gguf.o sgemm_noavx2.o common.o sampling.o kcpputils.o
95+
OBJS_SIMPLER += ggml-alloc.o ggml-cpu-traits.o ggml-quants_noavx1.o ggml-cpu-quants_noavx1.o ggml-cpu-aarch64_noavx1.o unicode.o unicode-data.o ggml-threading.o ggml-cpu-cpp.o gguf.o sgemm_noavx1.o common.o sampling.o kcpputils.o
96+
OBJS_FAILSAFE += ggml-alloc.o ggml-cpu-traits.o ggml-quants_failsafe.o ggml-cpu-quants_failsafe.o ggml-cpu-aarch64_failsafe.o unicode.o unicode-data.o ggml-threading.o ggml-cpu-cpp.o gguf.o sgemm_failsafe.o common.o sampling.o kcpputils.o
9797

9898
# OS specific
9999
ifeq ($(UNAME_S),Linux)
@@ -507,23 +507,23 @@ ggml-quants_noavx1.o: ggml/src/ggml-quants.c ggml/include/ggml.h ggml/src/ggml-q
507507
$(CC) $(CFLAGS) $(SIMPLERCFLAGS) -c $< -o $@
508508
ggml-quants_failsafe.o: ggml/src/ggml-quants.c ggml/include/ggml.h ggml/src/ggml-quants.h ggml/src/ggml-common.h
509509
$(CC) $(CFLAGS) $(NONECFLAGS) -c $< -o $@
510-
ggml-cpu-quants.o: ggml/src/ggml-cpu/quants.c ggml/include/ggml.h ggml/src/ggml-cpu/quants.h ggml/src/ggml-common.h
510+
ggml-cpu-quants.o: ggml/src/ggml-cpu/ggml-cpu-quants.c ggml/include/ggml.h ggml/src/ggml-cpu/ggml-cpu-quants.h ggml/src/ggml-common.h
511511
$(CC) $(CFLAGS) $(FULLCFLAGS) -c $< -o $@
512-
ggml-cpu-quants_noavx2.o: ggml/src/ggml-cpu/quants.c ggml/include/ggml.h ggml/src/ggml-cpu/quants.h ggml/src/ggml-common.h
512+
ggml-cpu-quants_noavx2.o: ggml/src/ggml-cpu/ggml-cpu-quants.c ggml/include/ggml.h ggml/src/ggml-cpu/ggml-cpu-quants.h ggml/src/ggml-common.h
513513
$(CC) $(CFLAGS) $(SIMPLECFLAGS) -c $< -o $@
514-
ggml-cpu-quants_noavx1.o: ggml/src/ggml-cpu/quants.c ggml/include/ggml.h ggml/src/ggml-cpu/quants.h ggml/src/ggml-common.h
514+
ggml-cpu-quants_noavx1.o: ggml/src/ggml-cpu/ggml-cpu-quants.c ggml/include/ggml.h ggml/src/ggml-cpu/ggml-cpu-quants.h ggml/src/ggml-common.h
515515
$(CC) $(CFLAGS) $(SIMPLERCFLAGS) -c $< -o $@
516-
ggml-cpu-quants_failsafe.o: ggml/src/ggml-cpu/quants.c ggml/include/ggml.h ggml/src/ggml-cpu/quants.h ggml/src/ggml-common.h
516+
ggml-cpu-quants_failsafe.o: ggml/src/ggml-cpu/ggml-cpu-quants.c ggml/include/ggml.h ggml/src/ggml-cpu/ggml-cpu-quants.h ggml/src/ggml-common.h
517517
$(CC) $(CFLAGS) $(NONECFLAGS) -c $< -o $@
518518

519-
#aarch64 repack
520-
ggml-cpu-repack.o: ggml/src/ggml-cpu/repack.cpp ggml/include/ggml.h ggml/src/ggml-cpu/repack.h
519+
#aarch64
520+
ggml-cpu-aarch64.o: ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp ggml/include/ggml.h ggml/src/ggml-cpu/ggml-cpu-aarch64.h
521521
$(CXX) $(CXXFLAGS) $(FULLCFLAGS) -c $< -o $@
522-
ggml-cpu-repack_noavx2.o: ggml/src/ggml-cpu/repack.cpp ggml/include/ggml.h ggml/src/ggml-cpu/repack.h
522+
ggml-cpu-aarch64_noavx2.o: ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp ggml/include/ggml.h ggml/src/ggml-cpu/ggml-cpu-aarch64.h
523523
$(CXX) $(CXXFLAGS) $(SIMPLECFLAGS) -c $< -o $@
524-
ggml-cpu-repack_noavx1.o: ggml/src/ggml-cpu/repack.cpp ggml/include/ggml.h ggml/src/ggml-cpu/repack.h
524+
ggml-cpu-aarch64_noavx1.o: ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp ggml/include/ggml.h ggml/src/ggml-cpu/ggml-cpu-aarch64.h
525525
$(CXX) $(CXXFLAGS) $(SIMPLERCFLAGS) -c $< -o $@
526-
ggml-cpu-repack_failsafe.o: ggml/src/ggml-cpu/repack.cpp ggml/include/ggml.h ggml/src/ggml-cpu/repack.h
526+
ggml-cpu-aarch64_failsafe.o: ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp ggml/include/ggml.h ggml/src/ggml-cpu/ggml-cpu-aarch64.h
527527
$(CXX) $(CXXFLAGS) $(NONECFLAGS) -c $< -o $@
528528

529529
#sgemm
@@ -545,7 +545,7 @@ unicode.o: src/unicode.cpp src/unicode.h
545545
$(CXX) $(CXXFLAGS) -c $< -o $@
546546
unicode-data.o: src/unicode-data.cpp src/unicode-data.h
547547
$(CXX) $(CXXFLAGS) -c $< -o $@
548-
ggml-cpu-traits.o: ggml/src/ggml-cpu/traits.cpp ggml/src/ggml-cpu/traits.h ggml/include/ggml.h
548+
ggml-cpu-traits.o: ggml/src/ggml-cpu/ggml-cpu-traits.cpp ggml/src/ggml-cpu/ggml-cpu-traits.h ggml/include/ggml.h
549549
$(CXX) $(CXXFLAGS) -c $< -o $@
550550
ggml-threading.o: ggml/src/ggml-threading.cpp ggml/include/ggml.h
551551
$(CXX) $(CXXFLAGS) -c $< -o $@

ggml/src/ggml-common.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,10 +1074,6 @@ GGML_TABLE_BEGIN(uint32_t, iq3s_grid, 512)
10741074
0x0f090307, 0x0f090501, 0x0f090b01, 0x0f0b0505, 0x0f0b0905, 0x0f0d0105, 0x0f0d0703, 0x0f0f0101,
10751075
GGML_TABLE_END()
10761076

1077-
GGML_TABLE_BEGIN(int8_t, kvalues_iq4nl, 16)
1078-
-127, -104, -83, -65, -49, -35, -22, -10, 1, 13, 25, 38, 53, 69, 89, 113,
1079-
GGML_TABLE_END()
1080-
10811077
#define NGRID_IQ1S 2048
10821078
#define IQ1S_DELTA 0.125f
10831079
#define IQ1M_DELTA 0.125f

0 commit comments

Comments
 (0)