From fdfaaecd5e4fbdcc04cc4c93bd3f2b061cd2758a Mon Sep 17 00:00:00 2001 From: Lizonghang <870644199@qq.com> Date: Wed, 12 Feb 2025 17:12:30 +0400 Subject: [PATCH] disable device profiler in standalone mode --- common/common.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/common.cpp b/common/common.cpp index 447de272..ec6a0d98 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -1473,8 +1473,10 @@ struct llama_init_result llama_init_from_gpt_params(gpt_params & params) { // get device profile LOG_INF("\nstart profiling this device, this may take some seconds ...\n"); dev_info.rank = params.rank; - llama_profile_device(&dev_info, model, ml, params.gpu_mem, params.n_predict, params.n_ctx, params.cpuparams.n_threads, params.flash_attn); - + if (n_world > 1) { + llama_profile_device(&dev_info, model, ml, params.gpu_mem, params.n_predict, params.n_ctx, params.cpuparams.n_threads, params.flash_attn); + } + // create llama context struct llama_context_params cparams = llama_context_params_from_gpt_params(params); llama_context * lctx = llama_new_context_with_model(model, cparams);