| 1 |
|
| 2 |
#define GGML_COMMON_DECL_C |
| 3 |
|
| 4 |
#include "ggml-quants.h" |
| 5 |
#include "vec.h" |
| 6 |
#include "quants.h" |
| 7 |
|
| 8 |
const struct ggml_type_traits type_traits[GGML_TYPE_COUNT] = { |
| 9 |
[GGML_TYPE_I8] = { |
| 10 |
.type_name = "i8", |
| 11 |
.blck_size = 1, |
| 12 |
.type_size = sizeof(int8_t), |
| 13 |
.is_quantized = false, |
| 14 |
}, |
| 15 |
[GGML_TYPE_I16] = { |
| 16 |
.type_name = "i16", |
| 17 |
.blck_size = 1, |
| 18 |
.type_size = sizeof(int16_t), |
| 19 |
.is_quantized = false, |
| 20 |
}, |
| 21 |
[GGML_TYPE_I32] = { |
| 22 |
.type_name = "i32", |
| 23 |
.blck_size = 1, |
| 24 |
.type_size = sizeof(int32_t), |
| 25 |
.is_quantized = false, |
| 26 |
}, |
| 27 |
[GGML_TYPE_I64] = { |
| 28 |
.type_name = "i64", |
| 29 |
.blck_size = 1, |
| 30 |
.type_size = sizeof(int64_t), |
| 31 |
.is_quantized = false, |
| 32 |
}, |
| 33 |
[GGML_TYPE_F64] = { |
| 34 |
.type_name = "f64", |
| 35 |
.blck_size = 1, |
| 36 |
.type_size = sizeof(double), |
| 37 |
.is_quantized = false, |
| 38 |
}, |
| 39 |
[GGML_TYPE_F32] = { |
| 40 |
.type_name = "f32", |
| 41 |
.blck_size = 1, |
| 42 |
.type_size = sizeof(float), |
| 43 |
.is_quantized = false, |
| 44 |
}, |
| 45 |
[GGML_TYPE_F16] = { |
| 46 |
.type_name = "f16", |
| 47 |
.blck_size = 1, |
| 48 |
.type_size = sizeof(ggml_fp16_t), |
| 49 |
.is_quantized = false, |
| 50 |
.to_float = (ggml_to_float_t) ggml_fp16_to_fp32_row, |
| 51 |
.from_float_ref = (ggml_from_float_t) ggml_fp32_to_fp16_row, |
| 52 |
}, |
| 53 |
[GGML_TYPE_Q4_0] = { |
| 54 |
.type_name = "q4_0", |
| 55 |
.blck_size = QK4_0, |
| 56 |
.type_size = sizeof(block_q4_0), |
| 57 |
.is_quantized = true, |
| 58 |
.to_float = (ggml_to_float_t) dequantize_row_q4_0, |
| 59 |
.from_float_ref = (ggml_from_float_t) quantize_row_q4_0_ref, |
| 60 |
}, |
| 61 |
[GGML_TYPE_Q4_1] = { |
| 62 |
.type_name = "q4_1", |
| 63 |
.blck_size = QK4_1, |
| 64 |
.type_size = sizeof(block_q4_1), |
| 65 |
.is_quantized = true, |
| 66 |
.to_float = (ggml_to_float_t) dequantize_row_q4_1, |
| 67 |
.from_float_ref = (ggml_from_float_t) quantize_row_q4_1_ref, |
| 68 |
}, |
| 69 |
[4] = { // GGML_TYPE_Q4_2 |
| 70 |
.type_name = "DEPRECATED", |
| 71 |
.blck_size = 0, |
| 72 |
.type_size = 0, |
| 73 |
.is_quantized = false, |
| 74 |
}, |
| 75 |
[5] = { // GGML_TYPE_Q4_3 |
| 76 |
.type_name = "DEPRECATED", |
| 77 |
.blck_size = 0, |
| 78 |
.type_size = 0, |
| 79 |
.is_quantized = false, |
| 80 |
}, |
| 81 |
[GGML_TYPE_Q5_0] = { |
| 82 |
.type_name = "q5_0", |
| 83 |
.blck_size = QK5_0, |
| 84 |
.type_size = sizeof(block_q5_0), |
| 85 |
.is_quantized = true, |
| 86 |
.to_float = (ggml_to_float_t) dequantize_row_q5_0, |
| 87 |
.from_float_ref = (ggml_from_float_t) quantize_row_q5_0_ref, |
| 88 |
}, |
| 89 |
[GGML_TYPE_Q5_1] = { |
| 90 |
.type_name = "q5_1", |
| 91 |
.blck_size = QK5_1, |
| 92 |
.type_size = sizeof(block_q5_1), |
| 93 |
.is_quantized = true, |
| 94 |
.to_float = (ggml_to_float_t) dequantize_row_q5_1, |
| 95 |
.from_float_ref = (ggml_from_float_t) quantize_row_q5_1_ref, |
| 96 |
}, |
| 97 |
[GGML_TYPE_Q8_0] = { |
| 98 |
.type_name = "q8_0", |
| 99 |
.blck_size = QK8_0, |
| 100 |
.type_size = sizeof(block_q8_0), |
| 101 |
.is_quantized = true, |
| 102 |
.to_float = (ggml_to_float_t) dequantize_row_q8_0, |
| 103 |
.from_float_ref = (ggml_from_float_t) quantize_row_q8_0_ref, |
| 104 |
}, |
| 105 |
[GGML_TYPE_Q8_1] = { |
| 106 |
.type_name = "q8_1", |
| 107 |
.blck_size = QK8_1, |
| 108 |
.type_size = sizeof(block_q8_1), |
| 109 |
.is_quantized = true, |
| 110 |
.from_float_ref = (ggml_from_float_t) quantize_row_q8_1_ref, |
| 111 |
}, |
| 112 |
[GGML_TYPE_MXFP4] = { |
| 113 |
.type_name = "mxfp4", |
| 114 |
.blck_size = QK_MXFP4, |
| 115 |
.type_size = sizeof(block_mxfp4), |
| 116 |
.is_quantized = true, |
| 117 |
.to_float = (ggml_to_float_t) dequantize_row_mxfp4, |
| 118 |
.from_float_ref = (ggml_from_float_t)quantize_row_mxfp4_ref, |
| 119 |
}, |
| 120 |
[GGML_TYPE_Q2_K] = { |
| 121 |
.type_name = "q2_K", |
| 122 |
.blck_size = QK_K, |
| 123 |
.type_size = sizeof(block_q2_K), |
| 124 |
.is_quantized = true, |
| 125 |
.to_float = (ggml_to_float_t) dequantize_row_q2_K, |
| 126 |
.from_float_ref = (ggml_from_float_t) quantize_row_q2_K_ref, |
| 127 |
}, |
| 128 |
[GGML_TYPE_Q3_K] = { |
| 129 |
.type_name = "q3_K", |
| 130 |
.blck_size = QK_K, |
| 131 |
.type_size = sizeof(block_q3_K), |
| 132 |
.is_quantized = true, |
| 133 |
.to_float = (ggml_to_float_t) dequantize_row_q3_K, |
| 134 |
.from_float_ref = (ggml_from_float_t) quantize_row_q3_K_ref, |
| 135 |
}, |
| 136 |
[GGML_TYPE_Q4_K] = { |
| 137 |
.type_name = "q4_K", |
| 138 |
.blck_size = QK_K, |
| 139 |
.type_size = sizeof(block_q4_K), |
| 140 |
.is_quantized = true, |
| 141 |
.to_float = (ggml_to_float_t) dequantize_row_q4_K, |
| 142 |
.from_float_ref = (ggml_from_float_t) quantize_row_q4_K_ref, |
| 143 |
}, |
| 144 |
[GGML_TYPE_Q5_K] = { |
| 145 |
.type_name = "q5_K", |
| 146 |
.blck_size = QK_K, |
| 147 |
.type_size = sizeof(block_q5_K), |
| 148 |
.is_quantized = true, |
| 149 |
.to_float = (ggml_to_float_t) dequantize_row_q5_K, |
| 150 |
.from_float_ref = (ggml_from_float_t) quantize_row_q5_K_ref, |
| 151 |
}, |
| 152 |
[GGML_TYPE_Q6_K] = { |
| 153 |
.type_name = "q6_K", |
| 154 |
.blck_size = QK_K, |
| 155 |
.type_size = sizeof(block_q6_K), |
| 156 |
.is_quantized = true, |
| 157 |
.to_float = (ggml_to_float_t) dequantize_row_q6_K, |
| 158 |
.from_float_ref = (ggml_from_float_t) quantize_row_q6_K_ref, |
| 159 |
}, |
| 160 |
[GGML_TYPE_IQ2_XXS] = { |
| 161 |
.type_name = "iq2_xxs", |
| 162 |
.blck_size = QK_K, |
| 163 |
.type_size = sizeof(block_iq2_xxs), |
| 164 |
.is_quantized = true, |
| 165 |
.to_float = (ggml_to_float_t) dequantize_row_iq2_xxs, |
| 166 |
.from_float_ref = NULL, |
| 167 |
}, |
| 168 |
[GGML_TYPE_IQ2_XS] = { |
| 169 |
.type_name = "iq2_xs", |
| 170 |
.blck_size = QK_K, |
| 171 |
.type_size = sizeof(block_iq2_xs), |
| 172 |
.is_quantized = true, |
| 173 |
.to_float = (ggml_to_float_t) dequantize_row_iq2_xs, |
| 174 |
.from_float_ref = NULL, |
| 175 |
}, |
| 176 |
[GGML_TYPE_IQ3_XXS] = { |
| 177 |
.type_name = "iq3_xxs", |
| 178 |
.blck_size = QK_K, |
| 179 |
.type_size = sizeof(block_iq3_xxs), |
| 180 |
.is_quantized = true, |
| 181 |
.to_float = (ggml_to_float_t) dequantize_row_iq3_xxs, |
| 182 |
.from_float_ref = (ggml_from_float_t)quantize_row_iq3_xxs_ref, |
| 183 |
}, |
| 184 |
[GGML_TYPE_IQ3_S] = { |
| 185 |
.type_name = "iq3_s", |
| 186 |
.blck_size = QK_K, |
| 187 |
.type_size = sizeof(block_iq3_s), |
| 188 |
.is_quantized = true, |
| 189 |
.to_float = (ggml_to_float_t) dequantize_row_iq3_s, |
| 190 |
.from_float_ref = (ggml_from_float_t)quantize_row_iq3_s_ref, |
| 191 |
}, |
| 192 |
[GGML_TYPE_IQ2_S] = { |
| 193 |
.type_name = "iq2_s", |
| 194 |
.blck_size = QK_K, |
| 195 |
.type_size = sizeof(block_iq2_s), |
| 196 |
.is_quantized = true, |
| 197 |
.to_float = (ggml_to_float_t) dequantize_row_iq2_s, |
| 198 |
.from_float_ref = (ggml_from_float_t)quantize_row_iq2_s_ref, |
| 199 |
}, |
| 200 |
[GGML_TYPE_IQ1_S] = { |
| 201 |
.type_name = "iq1_s", |
| 202 |
.blck_size = QK_K, |
| 203 |
.type_size = sizeof(block_iq1_s), |
| 204 |
.is_quantized = true, |
| 205 |
.to_float = (ggml_to_float_t) dequantize_row_iq1_s, |
| 206 |
.from_float_ref = NULL, |
| 207 |
}, |
| 208 |
[GGML_TYPE_IQ1_M] = { |
| 209 |
.type_name = "iq1_m", |
| 210 |
.blck_size = QK_K, |
| 211 |
.type_size = sizeof(block_iq1_m), |
| 212 |
.is_quantized = true, |
| 213 |
.to_float = (ggml_to_float_t) dequantize_row_iq1_m, |
| 214 |
.from_float_ref = NULL, |
| 215 |
}, |
| 216 |
[GGML_TYPE_IQ4_NL] = { |
| 217 |
.type_name = "iq4_nl", |
| 218 |
.blck_size = QK4_NL, |
| 219 |
.type_size = sizeof(block_iq4_nl), |
| 220 |
.is_quantized = true, |
| 221 |
.to_float = (ggml_to_float_t) dequantize_row_iq4_nl, |
| 222 |
.from_float_ref = (ggml_from_float_t)quantize_row_iq4_nl_ref, |
| 223 |
}, |
| 224 |
[GGML_TYPE_IQ4_XS] = { |
| 225 |
.type_name = "iq4_xs", |
| 226 |
.blck_size = QK_K, |
| 227 |
.type_size = sizeof(block_iq4_xs), |
| 228 |
.is_quantized = true, |
| 229 |
.to_float = (ggml_to_float_t) dequantize_row_iq4_xs, |
| 230 |
.from_float_ref = (ggml_from_float_t)quantize_row_iq4_xs_ref, |
| 231 |
}, |
| 232 |
[GGML_TYPE_Q8_K] = { |
| 233 |
.type_name = "q8_K", |
| 234 |
.blck_size = QK_K, |
| 235 |
.type_size = sizeof(block_q8_K), |
| 236 |
.is_quantized = true, |
| 237 |
}, |
| 238 |
[GGML_TYPE_BF16] = { |
| 239 |
.type_name = "bf16", |
| 240 |
.blck_size = 1, |
| 241 |
.type_size = sizeof(ggml_bf16_t), |
| 242 |
.is_quantized = false, |
| 243 |
.to_float = (ggml_to_float_t) ggml_bf16_to_fp32_row, |
| 244 |
.from_float_ref = (ggml_from_float_t) ggml_fp32_to_bf16_row_ref, |
| 245 |
}, |
| 246 |
[31] = { // GGML_TYPE_Q4_0_4_4 |
| 247 |
.type_name = "TYPE_Q4_0_4_4 REMOVED, use Q4_0 with runtime repacking", |
| 248 |
.blck_size = 0, |
| 249 |
.type_size = 0, |
| 250 |
.is_quantized = false, |
| 251 |
}, |
| 252 |
[32] = { // GGML_TYPE_Q4_0_4_8 |
| 253 |
.type_name = "TYPE_Q4_0_4_8 REMOVED, use Q4_0 with runtime repacking", |
| 254 |
.blck_size = 0, |
| 255 |
.type_size = 0, |
| 256 |
.is_quantized = false, |
| 257 |
}, |
| 258 |
[33] = { // GGML_TYPE_Q4_0_8_8 |
| 259 |
.type_name = "TYPE_Q4_0_8_8 REMOVED, use Q4_0 with runtime repacking", |
| 260 |
.blck_size = 0, |
| 261 |
.type_size = 0, |
| 262 |
.is_quantized = false, |
| 263 |
}, |
| 264 |
[GGML_TYPE_TQ1_0] = { |
| 265 |
.type_name = "tq1_0", |
| 266 |
.blck_size = QK_K, |
| 267 |
.type_size = sizeof(block_tq1_0), |
| 268 |
.is_quantized = true, |
| 269 |
.to_float = (ggml_to_float_t) dequantize_row_tq1_0, |
| 270 |
.from_float_ref = (ggml_from_float_t) quantize_row_tq1_0_ref, |
| 271 |
}, |
| 272 |
[GGML_TYPE_TQ2_0] = { |
| 273 |
.type_name = "tq2_0", |
| 274 |
.blck_size = QK_K, |
| 275 |
.type_size = sizeof(block_tq2_0), |
| 276 |
.is_quantized = true, |
| 277 |
.to_float = (ggml_to_float_t) dequantize_row_tq2_0, |
| 278 |
.from_float_ref = (ggml_from_float_t) quantize_row_tq2_0_ref, |
| 279 |
}, |
| 280 |
[36] = { // GGML_TYPE_IQ4_NL_4_4 |
| 281 |
.type_name = "TYPE_IQ4_NL_4_4 REMOVED, use IQ4_NL with runtime repacking", |
| 282 |
.blck_size = 0, |
| 283 |
.type_size = 0, |
| 284 |
.is_quantized = false, |
| 285 |
}, |
| 286 |
[37] = { // GGML_TYPE_IQ4_NL_4_8 |
| 287 |
.type_name = "TYPE_IQ4_NL_4_8 REMOVED, use IQ4_NL with runtime repacking", |
| 288 |
.blck_size = 0, |
| 289 |
.type_size = 0, |
| 290 |
.is_quantized = false, |
| 291 |
}, |
| 292 |
[38] = { // GGML_TYPE_IQ4_NL_8_8 |
| 293 |
.type_name = "TYPE_IQ4_NL_8_8 REMOVED, use IQ4_NL with runtime repacking", |
| 294 |
.blck_size = 0, |
| 295 |
.type_size = 0, |
| 296 |
.is_quantized = false, |
| 297 |
}, |
| 298 |
}; |
| 299 |
|
| 300 |
const struct ggml_type_traits_cpu type_traits_cpu[GGML_TYPE_COUNT] = { |
| 301 |
[GGML_TYPE_F32] = { |
| 302 |
.from_float = (ggml_from_float_t) ggml_cpu_fp32_to_fp32, |
| 303 |
.vec_dot = (ggml_vec_dot_t) ggml_vec_dot_f32, |
| 304 |
.vec_dot_type = GGML_TYPE_F32, |
| 305 |
.nrows = 1, |
| 306 |
}, |
| 307 |
[GGML_TYPE_F16] = { |
| 308 |
.from_float = (ggml_from_float_t) ggml_cpu_fp32_to_fp16, |
| 309 |
.vec_dot = (ggml_vec_dot_t) ggml_vec_dot_f16, |
| 310 |
.vec_dot_type = GGML_TYPE_F16, |
| 311 |
.nrows = 1, |
| 312 |
}, |
| 313 |
[GGML_TYPE_Q4_0] = { |
| 314 |
.from_float = quantize_row_q4_0, |
| 315 |
.vec_dot = ggml_vec_dot_q4_0_q8_0, |
| 316 |
.vec_dot_type = GGML_TYPE_Q8_0, |
| 317 |
#if defined (__ARM_FEATURE_MATMUL_INT8) |
| 318 |
.nrows = 2, |
| 319 |
#else |
| 320 |
.nrows = 1, |
| 321 |
#endif |
| 322 |
}, |
| 323 |
[GGML_TYPE_Q4_1] = { |
| 324 |
.from_float = quantize_row_q4_1, |
| 325 |
.vec_dot = ggml_vec_dot_q4_1_q8_1, |
| 326 |
.vec_dot_type = GGML_TYPE_Q8_1, |
| 327 |
#if defined (__ARM_FEATURE_MATMUL_INT8) |
| 328 |
.nrows = 2, |
| 329 |
#else |
| 330 |
.nrows = 1, |
| 331 |
#endif |
| 332 |
}, |
| 333 |
[GGML_TYPE_Q5_0] = { |
| 334 |
.from_float = quantize_row_q5_0, |
| 335 |
.vec_dot = ggml_vec_dot_q5_0_q8_0, |
| 336 |
.vec_dot_type = GGML_TYPE_Q8_0, |
| 337 |
.nrows = 1, |
| 338 |
}, |
| 339 |
[GGML_TYPE_Q5_1] = { |
| 340 |
.from_float = quantize_row_q5_1, |
| 341 |
.vec_dot = ggml_vec_dot_q5_1_q8_1, |
| 342 |
.vec_dot_type = GGML_TYPE_Q8_1, |
| 343 |
.nrows = 1, |
| 344 |
}, |
| 345 |
[GGML_TYPE_Q8_0] = { |
| 346 |
.from_float = quantize_row_q8_0, |
| 347 |
.vec_dot = ggml_vec_dot_q8_0_q8_0, |
| 348 |
.vec_dot_type = GGML_TYPE_Q8_0, |
| 349 |
#if defined (__ARM_FEATURE_MATMUL_INT8) |
| 350 |
.nrows = 2, |
| 351 |
#else |
| 352 |
.nrows = 1, |
| 353 |
#endif |
| 354 |
}, |
| 355 |
[GGML_TYPE_Q8_1] = { |
| 356 |
.from_float = quantize_row_q8_1, |
| 357 |
.vec_dot_type = GGML_TYPE_Q8_1, |
| 358 |
.nrows = 1, |
| 359 |
}, |
| 360 |
[GGML_TYPE_MXFP4] = { |
| 361 |
.from_float = quantize_row_mxfp4, |
| 362 |
.vec_dot = ggml_vec_dot_mxfp4_q8_0, |
| 363 |
.vec_dot_type = GGML_TYPE_Q8_0, |
| 364 |
.nrows = 1, |
| 365 |
}, |
| 366 |
[GGML_TYPE_Q2_K] = { |
| 367 |
.from_float = quantize_row_q2_K, |
| 368 |
.vec_dot = ggml_vec_dot_q2_K_q8_K, |
| 369 |
.vec_dot_type = GGML_TYPE_Q8_K, |
| 370 |
.nrows = 1, |
| 371 |
}, |
| 372 |
[GGML_TYPE_Q3_K] = { |
| 373 |
.from_float = quantize_row_q3_K, |
| 374 |
.vec_dot = ggml_vec_dot_q3_K_q8_K, |
| 375 |
.vec_dot_type = GGML_TYPE_Q8_K, |
| 376 |
.nrows = 1, |
| 377 |
}, |
| 378 |
[GGML_TYPE_Q4_K] = { |
| 379 |
.from_float = quantize_row_q4_K, |
| 380 |
.vec_dot = ggml_vec_dot_q4_K_q8_K, |
| 381 |
.vec_dot_type = GGML_TYPE_Q8_K, |
| 382 |
#if defined (__ARM_FEATURE_MATMUL_INT8) |
| 383 |
.nrows = 2, |
| 384 |
#else |
| 385 |
.nrows = 1, |
| 386 |
#endif |
| 387 |
}, |
| 388 |
[GGML_TYPE_Q5_K] = { |
| 389 |
.from_float = quantize_row_q5_K, |
| 390 |
.vec_dot = ggml_vec_dot_q5_K_q8_K, |
| 391 |
.vec_dot_type = GGML_TYPE_Q8_K, |
| 392 |
.nrows = 1, |
| 393 |
}, |
| 394 |
[GGML_TYPE_Q6_K] = { |
| 395 |
.from_float = quantize_row_q6_K, |
| 396 |
.vec_dot = ggml_vec_dot_q6_K_q8_K, |
| 397 |
.vec_dot_type = GGML_TYPE_Q8_K, |
| 398 |
#if defined (__ARM_FEATURE_MATMUL_INT8) |
| 399 |
.nrows = 2, |
| 400 |
#else |
| 401 |
.nrows = 1, |
| 402 |
#endif |
| 403 |
}, |
| 404 |
[GGML_TYPE_IQ2_XXS] = { |
| 405 |
.from_float = NULL, |
| 406 |
.vec_dot = ggml_vec_dot_iq2_xxs_q8_K, |
| 407 |
.vec_dot_type = GGML_TYPE_Q8_K, |
| 408 |
.nrows = 1, |
| 409 |
}, |
| 410 |
[GGML_TYPE_IQ2_XS] = { |
| 411 |
.from_float = NULL, |
| 412 |
.vec_dot = ggml_vec_dot_iq2_xs_q8_K, |
| 413 |
.vec_dot_type = GGML_TYPE_Q8_K, |
| 414 |
.nrows = 1, |
| 415 |
}, |
| 416 |
[GGML_TYPE_IQ3_XXS] = { |
| 417 |
// NOTE: from_float for iq3 and iq2_s was removed because these quants require initialization in ggml_quantize_init |
| 418 |
//.from_float = quantize_row_iq3_xxs, |
| 419 |
.vec_dot = ggml_vec_dot_iq3_xxs_q8_K, |
| 420 |
.vec_dot_type = GGML_TYPE_Q8_K, |
| 421 |
.nrows = 1, |
| 422 |
}, |
| 423 |
[GGML_TYPE_IQ3_S] = { |
| 424 |
//.from_float = quantize_row_iq3_s, |
| 425 |
.vec_dot = ggml_vec_dot_iq3_s_q8_K, |
| 426 |
.vec_dot_type = GGML_TYPE_Q8_K, |
| 427 |
.nrows = 1, |
| 428 |
}, |
| 429 |
[GGML_TYPE_IQ2_S] = { |
| 430 |
//.from_float = quantize_row_iq2_s, |
| 431 |
.vec_dot = ggml_vec_dot_iq2_s_q8_K, |
| 432 |
.vec_dot_type = GGML_TYPE_Q8_K, |
| 433 |
.nrows = 1, |
| 434 |
}, |
| 435 |
[GGML_TYPE_IQ1_S] = { |
| 436 |
.from_float = NULL, |
| 437 |
.vec_dot = ggml_vec_dot_iq1_s_q8_K, |
| 438 |
.vec_dot_type = GGML_TYPE_Q8_K, |
| 439 |
.nrows = 1, |
| 440 |
}, |
| 441 |
[GGML_TYPE_IQ1_M] = { |
| 442 |
.from_float = NULL, |
| 443 |
.vec_dot = ggml_vec_dot_iq1_m_q8_K, |
| 444 |
.vec_dot_type = GGML_TYPE_Q8_K, |
| 445 |
.nrows = 1, |
| 446 |
}, |
| 447 |
[GGML_TYPE_IQ4_NL] = { |
| 448 |
.from_float = quantize_row_iq4_nl, |
| 449 |
.vec_dot = ggml_vec_dot_iq4_nl_q8_0, |
| 450 |
.vec_dot_type = GGML_TYPE_Q8_0, |
| 451 |
.nrows = 1, |
| 452 |
}, |
| 453 |
[GGML_TYPE_IQ4_XS] = { |
| 454 |
.from_float = quantize_row_iq4_xs, |
| 455 |
.vec_dot = ggml_vec_dot_iq4_xs_q8_K, |
| 456 |
.vec_dot_type = GGML_TYPE_Q8_K, |
| 457 |
.nrows = 1, |
| 458 |
}, |
| 459 |
[GGML_TYPE_Q8_K] = { |
| 460 |
.from_float = quantize_row_q8_K, |
| 461 |
}, |
| 462 |
[GGML_TYPE_BF16] = { |
| 463 |
.from_float = (ggml_from_float_t) ggml_cpu_fp32_to_bf16, |
| 464 |
.vec_dot = (ggml_vec_dot_t) ggml_vec_dot_bf16, |
| 465 |
.vec_dot_type = GGML_TYPE_BF16, |
| 466 |
.nrows = 1, |
| 467 |
}, |
| 468 |
[GGML_TYPE_TQ1_0] = { |
| 469 |
.from_float = quantize_row_tq1_0, |
| 470 |
.vec_dot = ggml_vec_dot_tq1_0_q8_K, |
| 471 |
.vec_dot_type = GGML_TYPE_Q8_K, |
| 472 |
.nrows = 1, |
| 473 |
}, |
| 474 |
[GGML_TYPE_TQ2_0] = { |
| 475 |
.from_float = quantize_row_tq2_0, |
| 476 |
.vec_dot = ggml_vec_dot_tq2_0_q8_K, |
| 477 |
.vec_dot_type = GGML_TYPE_Q8_K, |
| 478 |
.nrows = 1, |
| 479 |
}, |
| 480 |
[GGML_TYPE_I32] = { |
| 481 |
.from_float = (ggml_from_float_t) ggml_cpu_fp32_to_i32, |
| 482 |
}, |
| 483 |
}; |