MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / total_quantization_error

Function total_quantization_error

smallthinker/tests/test-quantize-fns.cpp:48–55  ·  view source on GitHub ↗

Total quantization error on test data

Source from the content-addressed store, hash-verified

46
47// Total quantization error on test data
48static float total_quantization_error(const ggml_type_traits * qfns, const ggml_type_traits_cpu * qfns_cpu, size_t test_size, const float * test_data) {
49 std::vector<uint8_t> tmp_q(2*test_size);
50 std::vector<float> tmp_out(test_size);
51
52 qfns_cpu->from_float(test_data, tmp_q.data(), test_size);
53 qfns->to_float(tmp_q.data(), tmp_out.data(), test_size);
54 return array_rmse(test_data, tmp_out.data(), test_size);
55}
56
57// Total quantization error on test data
58static float reference_quantization_error(const ggml_type_traits * qfns, const ggml_type_traits_cpu * qfns_cpu, size_t test_size, const float * test_data) {

Callers 1

mainFunction · 0.70

Calls 2

array_rmseFunction · 0.70
dataMethod · 0.45

Tested by

no test coverage detected