pub enum LayerState {
Attention {
key_cache: Vec<f32>,
value_cache: Vec<f32>,
key_cache_f16: Vec<u16>,
value_cache_f16: Vec<u16>,
compressed_keys: Option<CompressedKeyCache>,
compressed_values: Option<CompressedValueCache>,
},
Conv {
buffer: Vec<f32>,
history: ConvHistory,
},
}Variants§
Attention
KV cache for attention layers.
Fields
§
key_cache_f16: Vec<u16>f16 key cache (IEEE-754 half bits). Populated when KvCompression::F16
is active; key_cache stays empty in that mode. Time-major
[seq_len × kv_dim], same layout as key_cache.
§
value_cache_f16: Vec<u16>f16 value cache (IEEE-754 half bits). Populated when KvCompression::F16
is active; value_cache stays empty in that mode.
§
compressed_keys: Option<CompressedKeyCache>Compressed key cache (populated when TurboQuant is active; key_cache stays empty).
§
compressed_values: Option<CompressedValueCache>Compressed value cache (populated when TurboQuant is active; value_cache stays empty).
Conv
Rolling buffer for convolution layers.
Stores previous d_conv pre-conv activations (bx values), time-major.
Fields
§
history: ConvHistoryPre-allocated ring buffer history snapshots for speculative decoding rollback.
Auto Trait Implementations§
impl Freeze for LayerState
impl RefUnwindSafe for LayerState
impl Send for LayerState
impl Sync for LayerState
impl Unpin for LayerState
impl UnsafeUnpin for LayerState
impl UnwindSafe for LayerState
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> 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