From: Georgi Gerganov Date: Sun, 25 Feb 2024 17:58:06 +0000 (+0200) Subject: sync : llama.cpp (#0) X-Git-Tag: upstream/0.0.1642~912 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=582d85ba7baf4d56334df4f9c99d822c7fb96715;p=pkg%2Fggml%2Fsources%2Fggml sync : llama.cpp (#0) --- diff --git a/examples/common-ggml.cpp b/examples/common-ggml.cpp index f1c7f6ef..7a360754 100644 --- a/examples/common-ggml.cpp +++ b/examples/common-ggml.cpp @@ -65,6 +65,7 @@ bool ggml_common_quantize_0( case GGML_FTYPE_MOSTLY_IQ2_XXS: case GGML_FTYPE_MOSTLY_IQ2_XS: case GGML_FTYPE_MOSTLY_IQ3_XXS: + case GGML_FTYPE_MOSTLY_IQ3_S: case GGML_FTYPE_MOSTLY_IQ1_S: case GGML_FTYPE_MOSTLY_IQ4_NL: { @@ -199,6 +200,7 @@ bool ggml_common_quantize_0( case GGML_TYPE_IQ2_XXS: case GGML_TYPE_IQ2_XS: case GGML_TYPE_IQ3_XXS: + case GGML_TYPE_IQ3_S: case GGML_TYPE_IQ1_S: case GGML_TYPE_IQ4_NL: case GGML_TYPE_COUNT: diff --git a/scripts/sync-llama.last b/scripts/sync-llama.last index f3be4198..9d75d02c 100644 --- a/scripts/sync-llama.last +++ b/scripts/sync-llama.last @@ -1 +1 @@ -96633eeca1265ed03e57230de54032041c58f9cd +f1a98c52546d009f742bdec2154c2a314ea950a6 diff --git a/tests/test2.c b/tests/test2.c index 839e3e6d..fb29a9fa 100644 --- a/tests/test2.c +++ b/tests/test2.c @@ -20,10 +20,10 @@ int main(int argc, const char ** argv) { .no_alloc = false, }; - //struct ggml_opt_params opt_params = ggml_opt_default_params(GGML_OPT_ADAM); + //struct ggml_opt_params opt_params = ggml_opt_default_params(GGML_OPT_TYPE_ADAM); //opt_params.adam.alpha = 0.01f; - struct ggml_opt_params opt_params = ggml_opt_default_params(GGML_OPT_LBFGS); + struct ggml_opt_params opt_params = ggml_opt_default_params(GGML_OPT_TYPE_LBFGS); // original threads: 8 int nthreads = 8; @@ -79,7 +79,7 @@ int main(int argc, const char ** argv) { printf("t0 = %f\n", ggml_get_f32_1d(t0, 0)); printf("t1 = %f\n", ggml_get_f32_1d(t1, 0)); - GGML_ASSERT(res == GGML_OPT_OK); + GGML_ASSERT(res == GGML_OPT_RESULT_OK); GGML_ASSERT(is_close(ggml_get_f32_1d(t0, 0), 5.0f, 1e-3f)); GGML_ASSERT(is_close(ggml_get_f32_1d(t1, 0), 10.0f, 1e-3f)); @@ -110,7 +110,7 @@ int main(int argc, const char ** argv) { enum ggml_opt_result res = ggml_opt(NULL, opt_params, f); - GGML_ASSERT(res == GGML_OPT_OK); + GGML_ASSERT(res == GGML_OPT_RESULT_OK); GGML_ASSERT(is_close(ggml_get_f32_1d(t0, 0), 5.0f, 1e-2f)); GGML_ASSERT(is_close(ggml_get_f32_1d(t1, 0), 10.0f, 1e-2f)); } @@ -131,7 +131,7 @@ int main(int argc, const char ** argv) { enum ggml_opt_result res = ggml_opt(NULL, opt_params, f); - GGML_ASSERT(res == GGML_OPT_OK); + GGML_ASSERT(res == GGML_OPT_RESULT_OK); GGML_ASSERT(is_close(ggml_get_f32_1d(f, 0), 0.0f, 1e-3f)); GGML_ASSERT(is_close(ggml_get_f32_1d(t0, 0), 0.0f, 1e-3f)); GGML_ASSERT(is_close(ggml_get_f32_1d(t1, 0), 0.0f, 1e-3f)); @@ -169,7 +169,7 @@ int main(int argc, const char ** argv) { enum ggml_opt_result res = ggml_opt(NULL, opt_params, f); - GGML_ASSERT(res == GGML_OPT_OK); + GGML_ASSERT(res == GGML_OPT_RESULT_OK); GGML_ASSERT(is_close(ggml_get_f32_1d(f, 0), 0.0f, 1e-3f)); GGML_ASSERT(is_close(ggml_get_f32_1d(t0, 0), 1.0f, 1e-3f)); GGML_ASSERT(is_close(ggml_get_f32_1d(t1, 0), 3.0f, 1e-3f)); diff --git a/tests/test3.c b/tests/test3.c index b92d6233..12aac708 100644 --- a/tests/test3.c +++ b/tests/test3.c @@ -15,8 +15,8 @@ int main(int argc, const char ** argv) { .no_alloc = false, }; - //struct ggml_opt_params opt_params = ggml_opt_default_params(GGML_OPT_ADAM); - struct ggml_opt_params opt_params = ggml_opt_default_params(GGML_OPT_LBFGS); + //struct ggml_opt_params opt_params = ggml_opt_default_params(GGML_OPT_TYPE_ADAM); + struct ggml_opt_params opt_params = ggml_opt_default_params(GGML_OPT_TYPE_LBFGS); opt_params.n_threads = (argc > 1) ? atoi(argv[1]) : 8; @@ -68,7 +68,7 @@ int main(int argc, const char ** argv) { enum ggml_opt_result res = ggml_opt(NULL, opt_params, f); - GGML_ASSERT(res == GGML_OPT_OK); + GGML_ASSERT(res == GGML_OPT_RESULT_OK); // print results for (int i = 0; i < 16; i++) {