From 893f9f4ef420dd68d3cb8958fb58d3cc02e57c36 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Tue, 3 Sep 2024 16:13:22 +0300 Subject: [PATCH] llama-bench : log benchmark progress more verbosely --- examples/llama-bench/llama-bench.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/llama-bench/llama-bench.cpp b/examples/llama-bench/llama-bench.cpp index f0fd3e9fd827ad..d5de7fac28fbce 100644 --- a/examples/llama-bench/llama-bench.cpp +++ b/examples/llama-bench/llama-bench.cpp @@ -1491,10 +1491,10 @@ int main(int argc, char ** argv) { llama_model * lmodel = nullptr; const cmd_params_instance * prev_inst = nullptr; - int params_idx = 1; + int params_idx = 0; for (const auto & inst : params_instances) { - LOG_TEE("llama-bench: starting benchmark %d/%ld\n", params_idx, params_instances.size()); params_idx ++; + LOG_TEE("llama-bench: benchmark %d/%ld: starting\n", params_idx, params_instances.size()); // keep the same model between tests when possible if (!lmodel || !prev_inst || !inst.equal_mparams(*prev_inst)) { if (lmodel) { @@ -1544,10 +1544,12 @@ int main(int argc, char ** argv) { // warmup run if (t.n_prompt > 0) { + LOG_TEE("llama-bench: benchmark %d/%ld: warmup prompt run\n", params_idx, params_instances.size()); //test_prompt(ctx, std::min(t.n_batch, std::min(t.n_prompt, 32)), 0, t.n_batch, t.n_threads); test_prompt(ctx, t.n_prompt, 0, t.n_batch, t.n_threads); } if (t.n_gen > 0) { + LOG_TEE("llama-bench: benchmark %d/%ld: warmup generation run\n", params_idx, params_instances.size()); test_gen(ctx, 1, 0, t.n_threads); } @@ -1557,9 +1559,11 @@ int main(int argc, char ** argv) { uint64_t t_start = get_time_ns(); if (t.n_prompt > 0) { + LOG_TEE("llama-bench: benchmark %d/%ld: prompt run %d/%d\n", params_idx, params_instances.size(), i + 1, params.reps); test_prompt(ctx, t.n_prompt, 0, t.n_batch, t.n_threads); } if (t.n_gen > 0) { + LOG_TEE("llama-bench: benchmark %d/%ld: generation run %d/%d\n", params_idx, params_instances.size(), i + 1, params.reps); test_gen(ctx, t.n_gen, t.n_prompt, t.n_threads); }