Skip to main content

HyperPrimeWorkspaceShape

Struct HyperPrimeWorkspaceShape 

Source
pub struct HyperPrimeWorkspaceShape {
    pub chunk_token_bytes: usize,
    pub prompt_bytes_per_token: usize,
    pub kpool_score_pool: usize,
    pub n_layers: usize,
    pub gdn_grid: bool,
}
Expand description

Per-request prefill WORKSPACE coefficients for a HyperConnections trunk, published to admission (lane/glm5-gpf-workspace, 2026-08-30). None for every non-hyper model: their admission arithmetic is byte-identical to the pre-lane behavior.

These are the FORMULA behind the 262k 2-card cell’s measured ~0.8 MiB/token/card prefill wall (research/glm53-flash-bringup-20260827/262k-2card-20260830/LANE.md), not the slope itself: each term is the size of a named allocation in the walk, summed per token of ONE prime call. On GLM-5.3-Flash geometry (H=4096, S=4, F=2048, U=8, heads=64, qk=256, v=256, topk=2048, P=4) chunk_token_bytes evaluates to ~0.86 MiB — the receipt’s slope with the conservative side up. The attribution table naming every term lives in research/glm53-flash-bringup-20260827/gpf-workspace-20260830/LANE.md §1.

Fields§

§chunk_token_bytes: usize

Bytes of per-call prefill transients PER TOKEN OF ONE PRIME CALL: the double-buffered [t, streams, hidden] stream state + ppN boundary slots, the pre/norm transients, the grouped-MoE staging (CSR activations + three f32 partial planes + f16 mirrors + scatter planes), the MLA query/attention planes, the k-pool idx plane, and the prime-tail hidden/norm pair. Multiplied by hyper_prime_call_rows this bounds the workspace of the CHUNKED prime; on the monolithic rollback (MEMRA_PRIME_CHUNK=0) the call rows are the whole prompt up to PRIME_CHUNK_LAUNCH_CAP (65,535 launch-legal max; admission re-derives hyper_prime_call_rows so the arithmetic stays consistent either way) and the same product stays honest.

§prompt_bytes_per_token: usize

Bytes per PROMPT token that live for the WHOLE prime on the last stage: the returned pre-output_norm hiddens stack (n_embd f32), consumed by the MTP-spec prompt_h and the embed capture.

§kpool_score_pool: usize

DSA k-pool group size P, or 0 when the model runs no k-pool indexer. The selection score plane of ONE call is call_rows * (ctx / P) f32 — the one prefill transient that stays COUPLED TO CONTEXT DEPTH after chunking (it is the allocation the 3-card 1M prime died on at 97.2 GiB).

§n_layers: usize

Trunk layer count, for re-deriving hyper_prime_call_rows at admission time with the same env-sensitive schedule the prime itself will walk.

§gdn_grid: bool

The model’s own GDN grid-alignment input to the schedule.

Implementations§

Source§

impl HyperPrimeWorkspaceShape

Source

pub fn admission_bytes(&self, prompt_rows: usize) -> usize

The admission charge for one request: workspace of the LARGEST prime call this request can produce, plus the ctx-coupled score plane at that call width, plus the prompt-long hiddens stack.

Keyed on PROMPT rows, deliberately not on ctx_cap: every term here is a function of what the PRIME walks, and a max_tokens-omitted request carries a ctx_cap of the whole server window — charging the window would refuse every vendor-default short prompt on a deep-window box for workspace it never allocates. A continuation request’s prompt is the full rendered conversation (the suffix optimization is internal reuse), so the score plane’s t_kv is covered too.

Trait Implementations§

Source§

impl Clone for HyperPrimeWorkspaceShape

Source§

fn clone(&self) -> HyperPrimeWorkspaceShape

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for HyperPrimeWorkspaceShape

Source§

impl Debug for HyperPrimeWorkspaceShape

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.