Skip to content

Commit 7d787ed

Browse files
authoredAug 26, 2024
ggml : do not crash when quantizing q4_x_x with an imatrix (ggml-org#9192)
1 parent 06658ad commit 7d787ed

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed
 

‎ggml/src/ggml-aarch64.c

+6-21
Original file line numberDiff line numberDiff line change
@@ -337,33 +337,18 @@ static size_t quantize_q4_0_nr_bl(const float * restrict src, void * restrict ds
337337
}
338338

339339
size_t quantize_q4_0_4x4(const float * restrict src, void * restrict dst, int64_t nrow, int64_t n_per_row, const float * quant_weights) {
340-
if (!quant_weights) {
341-
return quantize_q4_0_nr_bl(src, dst, nrow, n_per_row, 4, 4);
342-
}
343-
else {
344-
assert(false);
345-
return 0;
346-
}
340+
UNUSED(quant_weights);
341+
return quantize_q4_0_nr_bl(src, dst, nrow, n_per_row, 4, 4);
347342
}
348343

349344
size_t quantize_q4_0_4x8(const float * restrict src, void * restrict dst, int64_t nrow, int64_t n_per_row, const float * quant_weights) {
350-
if (!quant_weights) {
351-
return quantize_q4_0_nr_bl(src, dst, nrow, n_per_row, 4, 8);
352-
}
353-
else {
354-
assert(false);
355-
return 0;
356-
}
345+
UNUSED(quant_weights);
346+
return quantize_q4_0_nr_bl(src, dst, nrow, n_per_row, 4, 8);
357347
}
358348

359349
size_t quantize_q4_0_8x8(const float * restrict src, void * restrict dst, int64_t nrow, int64_t n_per_row, const float * quant_weights) {
360-
if (!quant_weights) {
361-
return quantize_q4_0_nr_bl(src, dst, nrow, n_per_row, 8, 8);
362-
}
363-
else {
364-
assert(false);
365-
return 0;
366-
}
350+
UNUSED(quant_weights);
351+
return quantize_q4_0_nr_bl(src, dst, nrow, n_per_row, 8, 8);
367352
}
368353

369354
void ggml_gemv_q4_0_4x4_q8_0(int n, float * restrict s, size_t bs, const void * restrict vx, const void * restrict vy, int nr, int nc) {

0 commit comments

Comments
 (0)
Please sign in to comment.