|
ember.cpp 0.1.0
C++ inference engine for Llama-family and paperkiln models (CPU, CUDA, WebAssembly)
|
Where the time went between generate() being called and its first output token being emitted (docs/TTFT.md). More...
#include <api.h>

Public Attributes | |
| std::chrono::steady_clock::time_point | t_entry |
| std::chrono::steady_clock::time_point | t_first_token |
| int | num_prompt_tokens = 0 |
| bool | first_token = false |
| bool | batch_prefill = false |
| double | tokenize_ms = 0.0 |
| double | kv_reset_ms = 0.0 |
| double | embed_ms = 0.0 |
| double | prefill_wall_ms = 0.0 |
| double | prefill_gpu_span_ms = -1.0 |
| double | sample_ms = 0.0 |
| double | ttft_ms = 0.0 |
| int | prefix_prev_cached_tokens = 0 |
| int | prefix_reusable_tokens = 0 |
| double | prefix_hit_rate = 0.0 |
| int | prefix_reused_tokens = 0 |
| int | spec_drafted = 0 |
| int | spec_accepted = 0 |
| int | spec_passes = 0 |
| double | spec_draft_ms = 0.0 |
| int | spec_draft_calls = 0 |
| std::map< std::string, double > | op_ms |
Where the time went between generate() being called and its first output token being emitted (docs/TTFT.md).
Every *_ms field is host wall-clock (steady_clock) except prefill_gpu_span_ms, which is the CUDA-event span of the batched prefill forward on the default stream. The span runs from the first to the last GPU op of the forward, so it INCLUDES any time the GPU sat idle waiting on the host (logging, synchronising copies) inside the forward; it is not the sum of kernel durations. Kernel busy time comes from a separate nsys pass. The phases tile the TTFT window with nothing left over except negligible glue, so ttft_ms ~= sum of the phase fields.
Definition at line 42 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| double tinyllama::TtftBreakdown::embed_ms = 0.0 |
Definition at line 45 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
Definition at line 41 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate(), and main().
| double tinyllama::TtftBreakdown::kv_reset_ms = 0.0 |
Definition at line 44 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| int tinyllama::TtftBreakdown::num_prompt_tokens = 0 |
Definition at line 40 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| std::map<std::string, double> tinyllama::TtftBreakdown::op_ms |
Definition at line 74 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| double tinyllama::TtftBreakdown::prefill_gpu_span_ms = -1.0 |
Definition at line 48 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| double tinyllama::TtftBreakdown::prefill_wall_ms = 0.0 |
Definition at line 46 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| double tinyllama::TtftBreakdown::prefix_hit_rate = 0.0 |
Definition at line 59 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| int tinyllama::TtftBreakdown::prefix_prev_cached_tokens = 0 |
Definition at line 57 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| int tinyllama::TtftBreakdown::prefix_reusable_tokens = 0 |
Definition at line 58 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| int tinyllama::TtftBreakdown::prefix_reused_tokens = 0 |
Definition at line 60 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| double tinyllama::TtftBreakdown::sample_ms = 0.0 |
Definition at line 49 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| int tinyllama::TtftBreakdown::spec_accepted = 0 |
Definition at line 64 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| int tinyllama::TtftBreakdown::spec_draft_calls = 0 |
Definition at line 69 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| double tinyllama::TtftBreakdown::spec_draft_ms = 0.0 |
Definition at line 68 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| int tinyllama::TtftBreakdown::spec_drafted = 0 |
Definition at line 63 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| int tinyllama::TtftBreakdown::spec_passes = 0 |
Definition at line 65 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| std::chrono::steady_clock::time_point tinyllama::TtftBreakdown::t_entry |
Definition at line 38 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| std::chrono::steady_clock::time_point tinyllama::TtftBreakdown::t_first_token |
Definition at line 39 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| double tinyllama::TtftBreakdown::tokenize_ms = 0.0 |
Definition at line 43 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().
| double tinyllama::TtftBreakdown::ttft_ms = 0.0 |
Definition at line 50 of file api.h.
Referenced by tinyllama::TinyLlamaSession::generate().