pub struct InferenceStats {
pub tokens_generated: usize,
pub cache_hits: usize,
pub total_attention_ops: usize,
pub avg_cache_len: f64,
pub peak_memory_bytes: usize,
}Expand description
Tracks statistics for autoregressive token generation with KV-cache.
Fields§
§tokens_generated: usizeTotal tokens generated so far.
cache_hits: usizeNumber of cache reads that avoided recomputation.
total_attention_ops: usizeTotal number of attention operations executed.
avg_cache_len: f64Running average of cache sequence length across recorded steps.
peak_memory_bytes: usizePeak memory usage in bytes observed across all steps.
Implementations§
Trait Implementations§
Source§impl Clone for InferenceStats
impl Clone for InferenceStats
Source§fn clone(&self) -> InferenceStats
fn clone(&self) -> InferenceStats
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InferenceStats
impl Debug for InferenceStats
Auto Trait Implementations§
impl Freeze for InferenceStats
impl RefUnwindSafe for InferenceStats
impl Send for InferenceStats
impl Sync for InferenceStats
impl Unpin for InferenceStats
impl UnsafeUnpin for InferenceStats
impl UnwindSafe for InferenceStats
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more