pub struct StepTrace {
pub q_len: usize,
pub kv_len: usize,
pub n_head: usize,
pub n_embd: usize,
pub embedding: Vec<f32>,
pub attn: Vec<AttnStep>,
pub detail: Vec<LayerDetail>,
pub ln_f_out: Vec<f32>,
pub top: Vec<(u32, f32)>,
}Expand description
Everything one decode step computed, read back in a single batched round
trip. A strict superset of AttnStep: attn is exactly what
Gpt2::logits_step_attn_async reports for the same step.
Fields§
§q_len: usizeQuery positions in this step: the whole prompt on prefill, 1 per decode.
kv_len: usizePast positions attended to, including the queries themselves.
n_head: usize§n_embd: usize§embedding: Vec<f32>[q_len, n_embd] — token + position embedding, before block 0.
Empty when detail_layers is 0.
attn: Vec<AttnStep>Every block, in layer order.
detail: Vec<LayerDetail>The first detail_layers blocks, in layer order.
ln_f_out: Vec<f32>[q_len, n_embd] — after the final LayerNorm, i.e. what the LM head
multiplies. Empty when detail_layers is 0.
top: Vec<(u32, f32)>Top-n (token id, probability), most likely first. Empty when top_n
is 0.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StepTrace
impl RefUnwindSafe for StepTrace
impl Send for StepTrace
impl Sync for StepTrace
impl Unpin for StepTrace
impl UnsafeUnpin for StepTrace
impl UnwindSafe for StepTrace
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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