]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
server: Fix undefined timing measurement errors in server context (#21201)
authorDan Hoffman <redacted>
Sat, 4 Apr 2026 14:11:19 +0000 (07:11 -0700)
committerGitHub <redacted>
Sat, 4 Apr 2026 14:11:19 +0000 (22:11 +0800)
Co-authored-by: Dan Hoffman <redacted>
tools/server/server-context.cpp
tools/server/server-task.h

index bd2552f75f26e2691359f013af39aef356988421..5523f23b540b47672c425228410558c12d8025f2 100644 (file)
@@ -155,8 +155,8 @@ struct server_slot {
     int64_t t_start_process_prompt;
     int64_t t_start_generation;
 
-    double t_prompt_processing; // ms
-    double t_token_generation;  // ms
+    double t_prompt_processing = 0.0; // ms
+    double t_token_generation = 0.0;  // ms
 
     std::function<void(int /* id_slot */)> callback_on_release;
 
index a49ddb594b986bf49784a406b6b0d0ec1e721fa1..d855bf0876ba206721402c5355e83a76134705f9 100644 (file)
@@ -261,14 +261,14 @@ struct result_timings {
     int32_t cache_n = -1;
 
     int32_t prompt_n = -1;
-    double prompt_ms;
-    double prompt_per_token_ms;
-    double prompt_per_second;
+    double prompt_ms = 0.0;
+    double prompt_per_token_ms = 0.0;
+    double prompt_per_second = 0.0;
 
     int32_t predicted_n = -1;
-    double predicted_ms;
-    double predicted_per_token_ms;
-    double predicted_per_second;
+    double predicted_ms = 0.0;
+    double predicted_per_token_ms = 0.0;
+    double predicted_per_second = 0.0;
 
     // Optional speculative metrics - only included when > 0
     int32_t draft_n = 0;