MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / llama_get_timings

Function llama_get_timings

llama.cpp:10826–10841  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10824}
10825
10826struct llama_timings llama_get_timings(struct llama_context * ctx) {
10827 struct llama_timings result = {
10828 /*.t_start_ms =*/ 1e-3 * ctx->t_start_us,
10829 /*.t_end_ms =*/ 1.00 * ggml_time_ms(),
10830 /*.t_load_ms =*/ 1e-3 * ctx->t_load_us,
10831 /*.t_sample_ms =*/ 1e-3 * ctx->t_sample_us,
10832 /*.t_p_eval_ms =*/ 1e-3 * ctx->t_p_eval_us,
10833 /*.t_eval_ms =*/ 1e-3 * ctx->t_eval_us,
10834
10835 /*.n_sample =*/ std::max(1, ctx->n_sample),
10836 /*.n_p_eval =*/ std::max(1, ctx->n_p_eval),
10837 /*.n_eval =*/ std::max(1, ctx->n_eval),
10838 };
10839
10840 return result;
10841}
10842
10843void llama_print_timings(struct llama_context * ctx) {
10844 const llama_timings timings = llama_get_timings(ctx);

Callers 1

llama_print_timingsFunction · 0.85

Calls 2

maxFunction · 0.85
ggml_time_msFunction · 0.70

Tested by

no test coverage detected