slaren commited on
Commit
d64f932
·
1 Parent(s): 90cc3cd

ggml : do not crash when quantizing q4_x_x with an imatrix (llama/9192)

Browse files
Files changed (1) hide show
  1. ggml/src/ggml-aarch64.c +6 -21
ggml/src/ggml-aarch64.c CHANGED
@@ -337,33 +337,18 @@ static size_t quantize_q4_0_nr_bl(const float * restrict src, void * restrict ds
337
  }
338
 
339
  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
- }
347
  }
348
 
349
  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
- }
357
  }
358
 
359
  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
- }
367
  }
368
 
369
  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) {
 
337
  }
338
 
339
  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
+ UNUSED(quant_weights);
341
+ return quantize_q4_0_nr_bl(src, dst, nrow, n_per_row, 4, 4);
 
 
 
 
 
342
  }
343
 
344
  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) {
345
+ UNUSED(quant_weights);
346
+ return quantize_q4_0_nr_bl(src, dst, nrow, n_per_row, 4, 8);
 
 
 
 
 
347
  }
348
 
349
  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) {
350
+ UNUSED(quant_weights);
351
+ return quantize_q4_0_nr_bl(src, dst, nrow, n_per_row, 8, 8);
 
 
 
 
 
352
  }
353
 
354
  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) {