Skip to main content

KdaRowsStash

Struct KdaRowsStash 

Source
pub struct KdaRowsStash {
    pub ring_snap: CudaSlice<f32>,
    pub raws: [CudaSlice<f32>; 3],
    pub scan: KdaScanInputs,
    pub rows: usize,
}
Expand description

The rollback stash of one BATCHED verify-rows KDA call (lane/glm5-verify-batch): the per-layer t=K+1 twin of the per-row KdaScanInputs steal. Everything here is either stolen from buffers the call allocated anyway (raws, scan — zero copies) or one small clone per layer per round (ring_snap, 3*qkv*(kernel-1) floats ~ 96 KiB).

Rollback to keep rows rebuilds both state planes EXACTLY:

  • conv ring: restore ring_snap, then re-issue kda_conv_ring_roll per plane over raws at T=keep — the roll is pure placement (no arithmetic), so the rebuilt ring is the sequential chain’s ring after row keep-1 byte-for-byte.
  • ssm state: ONE kda_scan replay at T=keep from the caller’s pre-round snapshot over the batched scan inputs (the kernel walks rows 0..keep of the [t, ..] buffers) — the in-kernel T-loop IS the chained t=1 program (register-resident state, identical per-step order), held by the scan-chain bit-gate.

Fields§

§ring_snap: CudaSlice<f32>

The fused conv ring BEFORE this call’s rolls (one clone per layer per round).

§raws: [CudaSlice<f32>; 3]

RAW (pre-conv) q/k/v projection rows [t, qkv], stolen post-roll (plane order).

§scan: KdaScanInputs

Batched scan inputs [t, ..], stolen post-scan.

§rows: usize

Row count of the call that filled this stash; rollback validates keep against it.

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.