Skip to content

Commit 334984e

Browse files
committed
ggml : explicitly initialize deprecated type traits
1 parent a1c3ff6 commit 334984e

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

ggml.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,28 @@ static const ggml_type_traits_t type_traits[GGML_TYPE_COUNT] = {
422422
.vec_dot = ggml_vec_dot_q4_1_q8_1,
423423
.vec_dot_type = GGML_TYPE_Q8_1,
424424
},
425+
[4] = { // GGML_TYPE_Q4_2
426+
.type_name = "DEPRECATED",
427+
.blck_size = 0,
428+
.type_size = 0,
429+
.is_quantized = false,
430+
.to_float = NULL,
431+
.from_float = NULL,
432+
.from_float_reference = NULL,
433+
.vec_dot = NULL,
434+
.vec_dot_type = GGML_TYPE_COUNT,
435+
},
436+
[5] = { // GGML_TYPE_Q4_3
437+
.type_name = "DEPRECATED",
438+
.blck_size = 0,
439+
.type_size = 0,
440+
.is_quantized = false,
441+
.to_float = NULL,
442+
.from_float = NULL,
443+
.from_float_reference = NULL,
444+
.vec_dot = NULL,
445+
.vec_dot_type = GGML_TYPE_COUNT,
446+
},
425447
[GGML_TYPE_Q5_0] = {
426448
.type_name = "q5_0",
427449
.blck_size = QK5_0,

tests/test-quantize-fns.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,13 @@ int main(int argc, char * argv[]) {
129129
ggml_type type = (ggml_type) i;
130130
ggml_type_traits_t qfns = ggml_internal_get_type_traits(type);
131131

132+
// deprecated - skip
133+
if (qfns.blck_size == 0) {
134+
continue;
135+
}
136+
137+
printf("Testing %s\n", ggml_type_name((ggml_type) i));
138+
132139
if (qfns.from_float && qfns.to_float) {
133140
const float total_error = total_quantization_error(qfns, test_size, test_data.data());
134141
const float max_quantization_error =

0 commit comments

Comments
 (0)