summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian <smith.adriane@gmail.com>2023-10-02 03:49:59 -0700
committerGitHub <noreply@github.com>2023-10-02 13:49:59 +0300
commita84767698495d72e44044f1f6db1c1cc721bfd15 (patch)
treea259ea61a8cfb0d219dfc8c876859b26a0ba1622
parent095231dfd32679e32300f8ffaf1770b693ea64b0 (diff)
metal : set log callback before initializing (#3427)
-rw-r--r--llama.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llama.cpp b/llama.cpp
index 3a0b2c30..05b570bd 100644
--- 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));
}