]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
metal : set log callback before initializing (#3427)
authorAdrian <redacted>
Mon, 2 Oct 2023 10:49:59 +0000 (03:49 -0700)
committerGitHub <redacted>
Mon, 2 Oct 2023 10:49:59 +0000 (13:49 +0300)
llama.cpp

index 3a0b2c308c57c0b8bcc98b90e4e09d4476d8c597..05b570bd12ee29041323cc6f9ce89766bd4d8ff6 100644 (file)
--- a/llama.cpp
+++ b/llama.cpp
@@ -6760,13 +6760,14 @@ struct llama_context * llama_new_context_with_model(
 
 #ifdef GGML_USE_METAL
             if (model->n_gpu_layers > 0) {
+                ggml_metal_log_set_callback(llama_log_callback_default, NULL);
+
                 ctx->ctx_metal = ggml_metal_init(1);
                 if (!ctx->ctx_metal) {
                     LLAMA_LOG_ERROR("%s: ggml_metal_init() failed\n", __func__);
                     llama_free(ctx);
                     return NULL;
                 }
-                ggml_metal_log_set_callback(llama_log_callback_default, NULL);
                 //ggml_metal_graph_find_concurrency(ctx->ctx_metal, gf, false);
                 //ggml_allocr_set_parse_seq(ctx->alloc, ggml_metal_get_concur_list(ctx->ctx_metal), ggml_metal_if_optimized(ctx->ctx_metal));
             }