Skip to content

Commit 575fb63

Browse files
committed
llama-bench : log benchmark progress more verbosely
1 parent fb6d5dd commit 575fb63

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/llama-bench/llama-bench.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,10 +1516,10 @@ int main(int argc, char ** argv) {
15161516
llama_model * lmodel = nullptr;
15171517
const cmd_params_instance * prev_inst = nullptr;
15181518

1519-
int params_idx = 1;
1519+
int params_idx = 0;
15201520
for (const auto & inst : params_instances) {
1521-
LOG_TEE("llama-bench: starting benchmark %d/%ld\n", params_idx, params_instances.size());
15221521
params_idx ++;
1522+
LOG_TEE("llama-bench: benchmark %d/%ld: starting\n", params_idx, params_instances.size());
15231523
// keep the same model between tests when possible
15241524
if (!lmodel || !prev_inst || !inst.equal_mparams(*prev_inst)) {
15251525
if (lmodel) {
@@ -1569,10 +1569,12 @@ int main(int argc, char ** argv) {
15691569

15701570
// warmup run
15711571
if (t.n_prompt > 0) {
1572+
LOG_TEE("llama-bench: benchmark %d/%ld: warmup prompt run\n", params_idx, params_instances.size());
15721573
//test_prompt(ctx, std::min(t.n_batch, std::min(t.n_prompt, 32)), 0, t.n_batch, t.n_threads);
15731574
test_prompt(ctx, t.n_prompt, 0, t.n_batch, t.n_threads);
15741575
}
15751576
if (t.n_gen > 0) {
1577+
LOG_TEE("llama-bench: benchmark %d/%ld: warmup generation run\n", params_idx, params_instances.size());
15761578
test_gen(ctx, 1, 0, t.n_threads);
15771579
}
15781580

@@ -1582,9 +1584,11 @@ int main(int argc, char ** argv) {
15821584
uint64_t t_start = get_time_ns();
15831585

15841586
if (t.n_prompt > 0) {
1587+
LOG_TEE("llama-bench: benchmark %d/%ld: prompt run %d/%d\n", params_idx, params_instances.size(), i + 1, params.reps);
15851588
test_prompt(ctx, t.n_prompt, 0, t.n_batch, t.n_threads);
15861589
}
15871590
if (t.n_gen > 0) {
1591+
LOG_TEE("llama-bench: benchmark %d/%ld: generation run %d/%d\n", params_idx, params_instances.size(), i + 1, params.reps);
15881592
test_gen(ctx, t.n_gen, t.n_prompt, t.n_threads);
15891593
}
15901594

0 commit comments

Comments
 (0)