Skip to main content

HyperDecodeWs

Struct HyperDecodeWs 

Source
pub struct HyperDecodeWs {
    pub mixes: CudaSlice<f32>,
    pub pre: CudaSlice<f32>,
    pub post: CudaSlice<f32>,
    pub comb: CudaSlice<f32>,
    pub y: CudaSlice<f32>,
    pub h: CudaSlice<f32>,
    pub z: CudaSlice<f32>,
    pub xb: CudaSlice<f32>,
    /* private fields */
}
Expand description

Persistent T=1 decode workspace for the hc glue (lane/glm5-decode-diet lever 2, MEMRA_HC_DECODE_WS). One per engine (pp stage), pooled on the Engine like fa_part_pool/router_stage: the launch-diet census measured 2,358 cuMemAllocAsync+Free calls/token (~2.5 ms of host time feeding the sync-serialized drain cycles), and the hc glue chain — mixes, gates, comb, collapse y, the two norm scratches and the two per-site post outputs — re-allocated all of it every token. Every buffer here is FULLY OVERWRITTEN before any read on every step (GEMV beta=0, block-per- token kernels, rms_norm, hc_post), which is what makes reuse byte-identical: the same kernels read and write the same values, only the allocator calls disappear.

The stream-state ping-pong deliberately has ONE slot (xb): the walk swaps the owned in-flight state x with xb after each site’s hc_post, so the pair rotates without a copy and the walk still returns an owned buffer to the caller (no signature churn at the stage boundary — the ppN transport consumes it exactly as before).

Fields§

§mixes: CudaSlice<f32>§pre: CudaSlice<f32>§post: CudaSlice<f32>§comb: CudaSlice<f32>§y: CudaSlice<f32>§h: CudaSlice<f32>

Attention-site rms_norm scratch (the walk’s h).

§z: CudaSlice<f32>

MLP-site rms_norm scratch (the walk’s z).

§xb: CudaSlice<f32>

The hc_post output slot the walk ping-pongs with the in-flight stream state.

Implementations§

Source§

impl HyperDecodeWs

Source

pub fn new( e: &Engine, topology: &HyperTopology, hidden: usize, ) -> Result<Self, Box<dyn Error>>

Source

pub fn matches(&self, topology: &HyperTopology, hidden: usize) -> bool

A pooled workspace is only reusable for the same trunk geometry; anything else is rebuilt (one engine serves one loaded model in practice, this is a guard, not a path).

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.