From d950154d250116cf278f754995cadb656038002f Mon Sep 17 00:00:00 2001 From: Stephan Walter Date: Sat, 22 Apr 2023 12:35:31 +0200 Subject: [PATCH] Fix CI: quantization unit tests, editorconfig --- examples/main/main.cpp | 2 +- llama.cpp | 1 - tests/test-quantize-fns.cpp | 2 +- tests/test-quantize-perf.cpp | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/main/main.cpp b/examples/main/main.cpp index 6d79a7e6f..decf41a9f 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -94,7 +94,7 @@ int main(int argc, char ** argv) { // params.prompt = R"(// this function checks if the number n is prime //bool is_prime(int n) {)"; - + llama_context * ctx; g_ctx = &ctx; diff --git a/llama.cpp b/llama.cpp index 4e92f5515..34327ecfa 100644 --- a/llama.cpp +++ b/llama.cpp @@ -2256,7 +2256,6 @@ std::vector>& llama_internal_get_te // Returns the size of the state size_t llama_get_state_size(struct llama_context * ctx) { - const size_t s_bool = sizeof(int32_t); // we don't know size of rng until we actually serialize it. so reserve more than enough memory for its serialized state. // for reference, std::mt19937(1337) serializes to 6701 bytes. const size_t s_rng_size = sizeof(size_t); diff --git a/tests/test-quantize-fns.cpp b/tests/test-quantize-fns.cpp index 5a5410152..7e091e8c4 100644 --- a/tests/test-quantize-fns.cpp +++ b/tests/test-quantize-fns.cpp @@ -120,7 +120,7 @@ int main(int argc, char * argv[]) { ggml_type type = (ggml_type) i; quantize_fns_t qfns = ggml_internal_get_quantize_fn(i); - if (qfns.quantize_row_q) { + if (qfns.quantize_row_q && qfns.dequantize_row_q) { const float total_error = total_quantization_error(qfns, test_size, test_data.data()); failed = !(total_error < MAX_QUANTIZATION_TOTAL_ERROR); num_failed += failed; diff --git a/tests/test-quantize-perf.cpp b/tests/test-quantize-perf.cpp index 883df05fe..d5514455d 100644 --- a/tests/test-quantize-perf.cpp +++ b/tests/test-quantize-perf.cpp @@ -225,7 +225,7 @@ int main(int argc, char * argv[]) { continue; } - if (qfns.quantize_row_q) { + if (qfns.quantize_row_q && qfns.dequantize_row_q) { printf("%s\n", ggml_type_name(type)); if (params.op_quantize_row_q_reference) {