@@ -13139,7 +13139,7 @@ static int iq1_find_best_neighbour(const uint16_t * restrict neighbours, const u
13139
13139
const float * restrict xval, const float * restrict weight, float * scale, int8_t * restrict L, int ngrid) {
13140
13140
int num_neighbors = neighbours[0];
13141
13141
GGML_ASSERT(num_neighbors > 0);
13142
- float best_score = 0 ;
13142
+ float best_score = -FLT_MAX ;
13143
13143
int grid_index = -1;
13144
13144
for (int j = 1; j <= num_neighbors; ++j) {
13145
13145
const int8_t * pg = (const int8_t *)(grid + neighbours[j]);
@@ -13337,7 +13337,7 @@ static void quantize_row_iq1_s_impl(const float * restrict x, void * restrict vy
13337
13337
sumw[j+1] = sumw[j] + weight[i];
13338
13338
}
13339
13339
}
13340
- float best_score = 0 , scale = max;
13340
+ float best_score = -FLT_MIN , scale = max;
13341
13341
int besti1 = -1, besti2 = -1, best_shift = 0;
13342
13342
for (int i1 = 0; i1 <= block_size; ++i1) {
13343
13343
for (int i2 = i1; i2 <= block_size; ++i2) {
@@ -13513,7 +13513,7 @@ static void quantize_row_iq1_m_impl(const float * restrict x, void * restrict vy
13513
13513
idx[2*j] = j;
13514
13514
}
13515
13515
qsort(pairs, block_size, 2*sizeof(float), iq1_sort_helper);
13516
- float best_score = 0 , scale = max;
13516
+ float best_score = -FLT_MIN , scale = max;
13517
13517
int besti1 = -1, besti2 = -1, best_k = -1;
13518
13518
// 0: +, +
13519
13519
// 1: +, -
0 commit comments