pub struct SpecStats {
pub accepted: u64,
pub rejected: u64,
pub bonus_tokens: u64,
pub total_elapsed: Duration,
pub n1_fallbacks: u64,
}Expand description
Per-generation acceptance statistics for the async speculative decoder.
Updated by the verification loop as tokens are accepted or rejected.
Fields§
§accepted: u64Number of candidate draft tokens that were accepted by the target.
rejected: u64Number of candidate draft tokens that were rejected by the target.
bonus_tokens: u64Number of bonus tokens sampled directly from the target (one per full-acceptance batch).
total_elapsed: DurationTotal wall-clock time spent in the async decoder.
n1_fallbacks: u64Number of times the decoder fell back to N=1 mode (SSM target).
Implementations§
Source§impl SpecStats
impl SpecStats
Sourcepub fn acceptance_rate(&self) -> f32
pub fn acceptance_rate(&self) -> f32
Token-level acceptance rate in [0.0, 1.0].
Returns 0.0 when no tokens have been evaluated.
Sourcepub fn total_output_tokens(&self) -> u64
pub fn total_output_tokens(&self) -> u64
Total tokens produced (accepted + bonus).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SpecStats
impl RefUnwindSafe for SpecStats
impl Send for SpecStats
impl Sync for SpecStats
impl Unpin for SpecStats
impl UnsafeUnpin for SpecStats
impl UnwindSafe for SpecStats
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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