You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix dead condition, division-by-zero, and uninitialized members in LLM stats (#18819)
Summary:
Pull Request resolved: #18819
Three issues fixed:
1. text_llm_runner.cpp: The condition num_generated_tokens == max_new_tokens
was always false because TextTokenGenerator::generate() receives
max_new_tokens - 1. Fixed to compare against max_new_tokens - 1.
2. stats.h print_report(): Division by zero when inference/prefill/decode
time is zero (e.g., during very fast warmup runs). Added guards matching
the pattern already used in stats_to_json_string().
3. stats.h Stats: Added default initializers (= 0) to all timestamp and
counter members to prevent undefined behavior from uninitialized reads.
Reviewed By: manuelcandales
Differential Revision: D99708774
0 commit comments