summaryrefslogtreecommitdiff
path: root/ggml/src/ggml-common.h
diff options
context:
space:
mode:
authorKawrakow <iwankawrakow@gmail.com>2024-12-21 11:26:35 +0100
committerGitHub <noreply@github.com>2024-12-21 11:26:35 +0100
commit93419de68f90fede135480a2717785d519df9f42 (patch)
tree615164646770d7fdb596f04af2d887a8441f3afb /ggml/src/ggml-common.h
parenta867b919ca1e26cc828f98c35b4c6926e8e54762 (diff)
IQ2_S_R4 (#156)
* iq2_s_r4: Zen4 * Minor * iq2_s_r4: NEON --------- Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
Diffstat (limited to 'ggml/src/ggml-common.h')
-rw-r--r--ggml/src/ggml-common.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/ggml/src/ggml-common.h b/ggml/src/ggml-common.h
index 2534b461..6964f5e6 100644
--- a/ggml/src/ggml-common.h
+++ b/ggml/src/ggml-common.h
@@ -428,6 +428,15 @@ typedef struct {
} block_iq2_s;
static_assert(sizeof(block_iq2_s) == sizeof(ggml_half) + QK_K/4 + QK_K/16, "wrong iq2_s block size/padding");
+typedef struct {
+ ggml_half d[4];
+ uint8_t qs[QK_K/2];
+ uint8_t qh[QK_K/8];
+ uint8_t signs[QK_K/2];
+ uint8_t scales[QK_K/8];
+} block_iq2_s_r4;
+static_assert(sizeof(block_iq2_s_r4) == 4*sizeof(block_iq2_s), "wrong iq2_s_r4 block size/padding");
+
// (Almost) "true" 3-bit quantization.
// Due to the need to use blocks as per ggml design, it ends up using
// 3.0625 bpw because of the 16-bit scale for each block of 256.