diff options
author | Iwan Kawrakow <iwan.kawrakow@gmail.com> | 2024-07-28 19:43:18 +0300 |
---|---|---|
committer | Kawrakow <48489457+ikawrakow@users.noreply.github.com> | 2024-08-01 09:38:06 +0200 |
commit | c85e139c68b0b0b15656cc0bc9618d632ed18822 (patch) | |
tree | f07e1f8c59522d286301c45de78d52ba48353ac4 /ggml/src/ggml-common.h | |
parent | 291066e6df5318c322a03e592483aae8820d3b19 (diff) |
iq2_k: Basics
Quantize/dequantize, CUDA deqantize, AVX512 iqk_mul_mat.
Diffstat (limited to 'ggml/src/ggml-common.h')
-rw-r--r-- | ggml/src/ggml-common.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ggml/src/ggml-common.h b/ggml/src/ggml-common.h index 755d52b9..9466dfcf 100644 --- a/ggml/src/ggml-common.h +++ b/ggml/src/ggml-common.h @@ -454,6 +454,14 @@ typedef struct { } block_iq4_k; static_assert(sizeof(block_iq4_k) == sizeof(ggml_half) + sizeof(uint16_t) + QK_K/2 + 3*QK_K/64, "wrong iq4_k block size/padding"); +typedef struct { + ggml_half d; + uint16_t extra; + uint8_t scales[QK_K/32]; + uint8_t qs[QK_K/4]; +} block_iq2_k; +static_assert(sizeof(block_iq2_k) == sizeof(ggml_half) + sizeof(uint16_t) + QK_K/32 + QK_K/4, "wrong iq2_k block size/padding"); + #endif // GGML_COMMON_DECL #endif // GGML_COMMON_DECL @@ -1890,5 +1898,10 @@ GGML_TABLE_BEGIN(int8_t, iq4k_values, 32) -123, -100, -79, -61, -45, -31, -18, -6, 5, 17, 29, 42, 57, 73, 93, 117 GGML_TABLE_END() +GGML_TABLE_BEGIN(int8_t, iq2nl_values, 8) + -31, -13, 1, 17, -26, -8, 6, 22 +GGML_TABLE_END() + + #endif // GGML_COMMON_IMPL #endif // GGML_COMMON_IMPL |