From cc46aa9828f3ff3223d895cd92d124cdccc06dc3 Mon Sep 17 00:00:00 2001 From: DeEMO Date: Thu, 15 May 2025 13:57:16 +0800 Subject: [PATCH] update rank and n_world Signed-off-by: DeEMO --- common/common.cpp | 24 ++++++++++++++++++++++++ include/llama.h | 6 +++++- src/llama.cpp | 9 +++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/common/common.cpp b/common/common.cpp index 991b34a5..88b00075 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -1702,6 +1702,30 @@ struct llama_init_result llama_init_from_gpt_params(gpt_params & params) { } } + //update rank and n_world for consistency + uint32_t update_rank = 0; + uint32_t update_n_world = 1; + std::vector n_layer_window_temp = {n_layer_window[0]}; + std::vector n_gpu_layers_temp = {n_gpu_layers[0]}; + for(auto i=1; icparams.rank = rank; + ctx->cparams.n_world = n_world; + } +} + struct llama_context * llama_new_context_with_model( struct llama_model * model, struct llama_context_params params) {