summaryrefslogtreecommitdiff
path: root/ggml/src/ggml-common.h
diff options
context:
space:
mode:
authorKawrakow <iwankawrakow@gmail.com>2024-12-02 07:25:39 +0100
committerGitHub <noreply@github.com>2024-12-02 07:25:39 +0100
commit6d0462d4a39085a9f9da04e0a5fc7cc9d4578818 (patch)
treeb7fd71bda09bb8e2315feff8b6128ad0b7cbefc7 /ggml/src/ggml-common.h
parent8ad84b9fab9570c36220cb791f9a67a4d2c7fd2f (diff)
IQ4_NL_X4 (#118)
* Adding iq4_nl_x4 Looks very promising - I get PP-512(LLaMA-3.1-8B) = 230 t/s on the Ryzen-7950X! This is faster than any other quant and ~40% faster than iq4_nl. * iq4_nl_x4: getting amazing This Zen4 variant gets us to PP-512(LLaMA-3.1-8B) = 263 t/s! * iq4_nl_x4: AVX2 Here we gain only 25% compared to iq4_nl * iq4_nl_x4: NEON On M2-Max we get PP-512(LLaMA-3.1-8B) = 109.7 t/s, up from 82.4 t/s for iq4_nl. * iq4_nl_x4: minor NEON improvement and cleanup This gets us to 110.3 t/s. In comparison, IQ4_NL_4_4 in mainline llama.cpp achieves 92.3 t/s. * iq4_nl_x4: NEON specialization for matrix x vector --------- Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
Diffstat (limited to 'ggml/src/ggml-common.h')
-rw-r--r--ggml/src/ggml-common.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/ggml/src/ggml-common.h b/ggml/src/ggml-common.h
index f0c1ae68..2af3323d 100644
--- a/ggml/src/ggml-common.h
+++ b/ggml/src/ggml-common.h
@@ -419,6 +419,11 @@ typedef struct {
uint8_t qs[QK4_NL/2];
} block_iq4_nl;
static_assert(sizeof(block_iq4_nl) == sizeof(ggml_half) + QK4_NL/2, "wrong iq4_nl block size/padding");
+typedef struct {
+ ggml_half d[4];
+ uint8_t qs[2*QK4_NL];
+} block_iq4_nl_x4;
+static_assert(sizeof(block_iq4_nl_x4) == 4*sizeof(ggml_half) + 2*QK4_NL, "wrong iq4_nl_x4 block size/padding");
typedef struct {
ggml_half d;