From c85e139c68b0b0b15656cc0bc9618d632ed18822 Mon Sep 17 00:00:00 2001 From: Iwan Kawrakow Date: Sun, 28 Jul 2024 19:43:18 +0300 Subject: iq2_k: Basics Quantize/dequantize, CUDA deqantize, AVX512 iqk_mul_mat. --- ggml/src/ggml-common.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'ggml/src/ggml-common.h') 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 -- cgit v1.2.3