From bad53ad19001e142c5c7c03f972e1e87dae8564e Mon Sep 17 00:00:00 2001 From: James Ravenscroft Date: Wed, 23 Aug 2023 14:57:31 +0000 Subject: [PATCH] add debug logs to codegen --- src/gptj.cpp | 4 ++++ src/gptneox.cpp | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gptj.cpp b/src/gptj.cpp index 64ebd69..f00e107 100644 --- a/src/gptj.cpp +++ b/src/gptj.cpp @@ -642,5 +642,9 @@ std::stringstream GPTJModel::predict(std::string prompt, int max_length, bool in } } + spdlog::debug("{}: sample time = {:8.2f} ms\n", __func__, t_sample_us/1000.0f); + spdlog::debug("{}: predict time = {:8.2f} ms / {:.2f} ms per token\n", __func__, t_predict_us/1000.0f, t_predict_us/1000.0f/n_past); + + return result; } diff --git a/src/gptneox.cpp b/src/gptneox.cpp index b7fca3b..51665c7 100644 --- a/src/gptneox.cpp +++ b/src/gptneox.cpp @@ -709,8 +709,6 @@ std::stringstream GPTNEOXModel::predict(std::string prompt, int max_length, bool break; } } - - t_response_us = ggml_time_us() - t_start_us - t_prompt_us; spdlog::debug("{}: sample time = {:8.2f} ms\n", __func__, t_sample_us/1000.0f); spdlog::debug("{}: predict time = {:8.2f} ms / {:.2f} ms per token\n", __func__, t_predict_us/1000.0f, t_predict_us/1000.0f/n_past);