Skip to main content

LayerCache

Struct LayerCache 

Source
pub struct LayerCache {
    pub kvc: CudaSlice<f32>,
    pub n_blocks: usize,
    pub pend_kv: Option<CudaSlice<f32>>,
    pub pend_score: Option<CudaSlice<f32>>,
    pub ikvc: Option<CudaSlice<f32>>,
    pub i_blocks: usize,
    pub ipend_kv: Option<CudaSlice<f32>>,
    pub ipend_score: Option<CudaSlice<f32>>,
}
Expand description

Lane-6 decode cache for ONE trunk layer, on the layer’s owning stage. Layout mirrors the reference (model.py:473-474, :491): kvc = [win + cap_blocks, hd] f32 with the 128-slot window ring at rows [0, win) (slot = pos % win, M:530) and compressed block j at row win + j (decode index offset = win, M:509). Pending state = RAW wkv/wgate rows (ape added at pool time — see the lane-6 receipts): fine [2·ratio, latent] with rows [0, ratio) = previous block / [ratio, 2·ratio) = current (M:344-370 state machine); coarse [ratio, latent]. pend_score is initialized to −inf so a block with no predecessor reproduces the reference j==0 masking bit-exactly.

Fields§

§kvc: CudaSlice<f32>§n_blocks: usize§pend_kv: Option<CudaSlice<f32>>§pend_score: Option<CudaSlice<f32>>§ikvc: Option<CudaSlice<f32>>

indexer compressed-kv store [cap_blocks, index_head_dim] (FP4-QAT’d values) + its own pending pair — fine layers only.

§i_blocks: usize§ipend_kv: Option<CudaSlice<f32>>§ipend_score: Option<CudaSlice<f32>>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.