| 10885 | } |
| 10886 | |
| 10887 | void llama_dump_timing_info_yaml(FILE * stream, const llama_context * ctx) { |
| 10888 | fprintf(stream, "\n"); |
| 10889 | fprintf(stream, "###########\n"); |
| 10890 | fprintf(stream, "# Timings #\n"); |
| 10891 | fprintf(stream, "###########\n"); |
| 10892 | fprintf(stream, "\n"); |
| 10893 | |
| 10894 | fprintf(stream, "mst_eval: %.2f # ms / token during generation\n", |
| 10895 | 1.0e-3 * ctx->t_eval_us / ctx->n_eval); |
| 10896 | fprintf(stream, "mst_p_eval: %.2f # ms / token during prompt processing\n", |
| 10897 | 1.0e-3 * ctx->t_p_eval_us / ctx->n_p_eval); |
| 10898 | fprintf(stream, "mst_sample: %.2f # ms / token during sampling\n", |
| 10899 | 1.0e-3 * ctx->t_sample_us / ctx->n_sample); |
| 10900 | fprintf(stream, "n_eval: %d # number of tokens generated (excluding the first one)\n", ctx->n_eval); |
| 10901 | fprintf(stream, "n_p_eval: %d # number of tokens processed in batches at the beginning\n", ctx->n_p_eval); |
| 10902 | fprintf(stream, "n_sample: %d # number of sampled tokens\n", ctx->n_sample); |
| 10903 | fprintf(stream, "t_eval_us: %" PRId64 " # total microseconds spent generating tokens\n", ctx->t_eval_us); |
| 10904 | fprintf(stream, "t_load_us: %" PRId64 " # total microseconds spent loading the model\n", ctx->t_load_us); |
| 10905 | fprintf(stream, "t_p_eval_us: %" PRId64 " # total microseconds spent prompt processing\n", ctx->t_p_eval_us); |
| 10906 | fprintf(stream, "t_sample_us: %" PRId64 " # total microseconds spent sampling\n", ctx->t_sample_us); |
| 10907 | fprintf(stream, "ts_eval: %.2f # tokens / second during generation\n", |
| 10908 | 1.0e6 * ctx->n_eval / ctx->t_eval_us); |
| 10909 | fprintf(stream, "ts_p_eval: %.2f # tokens / second during prompt processing\n", |
| 10910 | 1.0e6 * ctx->n_p_eval / ctx->t_p_eval_us); |
| 10911 | fprintf(stream, "ts_sample: %.2f # tokens / second during sampling\n", |
| 10912 | 1.0e6 * ctx->n_sample / ctx->t_sample_us); |
| 10913 | } |
| 10914 | |
| 10915 | // For internal test use |
| 10916 | const std::vector<std::pair<std::string, struct ggml_tensor *>> & llama_internal_get_tensor_map( |
no test coverage detected