Skip to content

Commit

Permalink
llama-bench : log benchmark progress more verbosely
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Sep 3, 2024
1 parent 03c3e9e commit 893f9f4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/llama-bench/llama-bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand Down

0 comments on commit 893f9f4

Please sign in to comment.