@@ -142,7 +142,7 @@ void test_roundtrip_on_chunk(
142
142
const ggml_tensor * layer,
143
143
int64_t offset,
144
144
int64_t chunk_size,
145
- const quantize_fns_t & qfns,
145
+ const ggml_type_handling_t & qfns,
146
146
bool use_reference,
147
147
float * input_scratch,
148
148
char * quantized_scratch,
@@ -158,11 +158,11 @@ void test_roundtrip_on_chunk(
158
158
}
159
159
160
160
if (use_reference) {
161
- qfns.quantize_row_q_reference (input_scratch, quantized_scratch, chunk_size);
161
+ qfns.from_float_reference (input_scratch, quantized_scratch, chunk_size);
162
162
} else {
163
- qfns.quantize_row_q (input_scratch, quantized_scratch, chunk_size);
163
+ qfns.from_float (input_scratch, quantized_scratch, chunk_size);
164
164
}
165
- qfns.dequantize_row_q (quantized_scratch, output_scratch, chunk_size);
165
+ qfns.to_float (quantized_scratch, output_scratch, chunk_size);
166
166
167
167
update_error_stats (chunk_size, input_scratch, output_scratch, stats);
168
168
}
@@ -172,7 +172,7 @@ void test_roundtrip_on_chunk(
172
172
void test_roundtrip_on_layer (
173
173
std::string & name,
174
174
bool print_layer_stats,
175
- const quantize_fns_t & qfns,
175
+ const ggml_type_handling_t & qfns,
176
176
bool use_reference,
177
177
const ggml_tensor * layer,
178
178
std::vector<float > & input_scratch,
@@ -371,8 +371,8 @@ int main(int argc, char ** argv) {
371
371
if (!params.include_types .empty () && std::find (params.include_types .begin (), params.include_types .end (), i) == params.include_types .end ()) {
372
372
continue ;
373
373
}
374
- quantize_fns_t qfns = ggml_internal_get_quantize_fn (i );
375
- if (qfns.quantize_row_q && qfns.dequantize_row_q ) {
374
+ ggml_type_handling_t qfns = ggml_internal_get_type_handling (type );
375
+ if (qfns.from_float && qfns.to_float ) {
376
376
if (params.verbose ) {
377
377
printf (" testing %s ...\n " , ggml_type_name (type));
378
378
}
0 commit comments