1
- From 3eaa2789f0099dbdd2f36efce4d1eeb6edfda033 Mon Sep 17 00:00:00 2001
2
- From: Gian Marco Iodice <gianmarco.iodice@ arm.com>
3
- Date: Fri, 14 Jun 2024 14:55:47 +0100
4
- Subject: [PATCH] Use KleidiAI Int4 Matmul micro-kernels in llama.cpp
1
+ From 453e52a763043e95b23c88176792e065377189ad Mon Sep 17 00:00:00 2001
2
+ From: Charles Xu <chaxu01@e125126. arm.com>
3
+ Date: Tue, 9 Jul 2024 08:49:27 +0200
4
+ Subject: [PATCH] Updated to be able to build on Linux
5
5
6
- * Update CMake file to fetch the Int4 micro-kernels from the KleidiAI
7
- repository
8
- * Implement a KleidiAI backend for llama.cpp
9
-
10
- Signed-off-by: Gian Marco Iodice <
[email protected] >
11
6
---
12
7
CMakeLists.txt | 48 ++++
13
8
ggml-alloc.c | 13 ++
14
- ggml-kleidiai.cpp | 561 ++++++++++++++++++++++++++++++++++++++++++++++
9
+ ggml-kleidiai.cpp | 560 ++++++++++++++++++++++++++++++++++++++++++++++
15
10
ggml-kleidiai.h | 45 ++++
16
11
ggml.c | 27 +++
17
12
llama.cpp | 19 +-
18
- 6 files changed, 712 insertions(+), 1 deletion(-)
13
+ 6 files changed, 711 insertions(+), 1 deletion(-)
19
14
create mode 100644 ggml-kleidiai.cpp
20
15
create mode 100644 ggml-kleidiai.h
21
16
@@ -118,10 +113,10 @@ index bd367c42..ed4ce0ae 100644
118
113
if (this_size > max_size) {
119
114
diff --git a/ggml-kleidiai.cpp b/ggml-kleidiai.cpp
120
115
new file mode 100644
121
- index 00000000..9e343c86
116
+ index 00000000..aa53086d
122
117
--- /dev/null
123
118
+++ b/ggml-kleidiai.cpp
124
- @@ -0,0 +1,561 @@
119
+ @@ -0,0 +1,560 @@
125
120
+ /*
126
121
+ * Copyright (c) 2024 Arm Limited.
127
122
+ *
@@ -146,7 +141,7 @@ index 00000000..9e343c86
146
141
+ * SOFTWARE.
147
142
+ */
148
143
+
149
- + #if defined(__aarch64__) && defined(__ANDROID__)
144
+ + #if defined(__aarch64__) && ( defined(__ANDROID__) || defined(__linux__) )
150
145
+ #include "ggml-kleidiai.h"
151
146
+
152
147
+ #include "ggml.h"
@@ -681,8 +676,7 @@ index 00000000..9e343c86
681
676
+ }
682
677
+ extra_mem_idx = 0;
683
678
+ }
684
- +
685
- + #endif // defined(__aarch64__) && defined(__ANDROID__)
679
+ + #endif // defined(__aarch64__) && (defined(__ANDROID__) || defined(__linux__))
686
680
diff --git a/ggml-kleidiai.h b/ggml-kleidiai.h
687
681
new file mode 100644
688
682
index 00000000..a4cdf1fb
@@ -846,5 +840,5 @@ index 05591aa4..735dde04 100644
846
840
}
847
841
848
842
- -
849
- 2.25 .1
843
+ 2.34 .1
850
844
0 commit comments