fix: add warm-up in profiling to prevent init delay

This commit is contained in:
Li, Zonghang 2025-06-03 17:10:09 +04:00
parent b30f749e5e
commit 1b3b6a506f
2 changed files with 9 additions and 6 deletions

View file

@ -439,7 +439,7 @@ float device_inp_embd_delay(struct llama_model * model, enum ggml_type src0t, in
}
// warm-up
// ggml_backend_graph_compute(backend, gf);
ggml_backend_graph_compute(backend, gf);
const int64_t t_start = ggml_time_us();
ggml_backend_graph_compute(backend, gf);
@ -1288,6 +1288,9 @@ static float device_mem_copy(struct llama_model * model, enum profiler_backend_t
ggml_backend_cpu_set_n_threads(backend, n_threads);
}
// warm-up
ggml_backend_graph_compute(backend, gf);
const int64_t t_start = ggml_time_us();
ggml_backend_graph_compute(backend, gf);
const int64_t t_end = ggml_time_us();