diff --git a/src/llama-context.cpp b/src/llama-context.cpp index 24491e9309a5c..c9b54c0fcf96a 100644 --- a/src/llama-context.cpp +++ b/src/llama-context.cpp @@ -1091,10 +1091,14 @@ int llama_context::decode(const llama_batch & batch_inp) { const auto * res = process_ubatch(ubatch, LLM_GRAPH_TYPE_DECODER, mctx.get(), status); #if defined(GGML_PERF) || defined(GGML_PERF_RELEASE) + if (res) { ggml_perf_accumulate(perf_totals, res->get_gf()); + } #elif defined(GGML_PERF_DETAIL) + if (res) { ggml_perf_accumulate(perf_totals, res->get_gf()); ggml_perf_write_detailed_csv(res->get_gf(), perf_all_shape_fp); + } #endif /* GML_PERF-related flags */