pub struct DecodeW8a8Plan {
pub rows: usize,
pub n: u32,
pub k: u32,
pub ldc: u32,
pub out_capacity_bytes: usize,
}Expand description
Everything the decode W8A8 cuBLASLt arm needs, as a PURE function of shape, format, lever and handles — so the CPU tests pin every clause without a GPU and without touching the process environment.
Clauses, each load-bearing:
family_armed— the caller’s slice ofsuper::CublasScope(cublas.ssm/cublas.attn). Arming the dense FFN must not arm these; that separation is the whole point of the scoped lever (#917’s 10.3 GiB).!disabled— theATLAS_NO_W8A8_DECODE_PROJkill switch.DECODE_W8A8_ROWS.contains(&rows)— the 5..=16 band, on the PADDED n.Fp8BlockScaled— cuBLASLt is told the weight scales are a BLK128x128 grid; a per-rowrow_scalehas a different shape and reads as garbage.n % 128 == 0,k % 128 == 0— that grid is[N/128, K/128]and the activation quantizer emits one scale per 128-wide K group.blk128x128_stride_ok(k)(i.e.k % 512 == 0) — cuBLAS requires the weight-scale column strideK/128to be a multiple of 4.ldc >= n— a leading dimension shorter than the column is rejected by the library; for a contiguous output the caller passesldc = n.- OUTPUT ROOM for the full padded write extent (see
strided_out_extent_elems). - the quantizer kernel, and the VEC128 scale-layout adapter (kernel AND
scratch AND its capacity, and the FP8/scale scratch capacities). cuBLASLt
reads the activation scales token-contiguous; handing over the
quantizer’s
[M, K/128]order is fast and WRONG (H100 2026-09-11: rel_rms 7.7e-2 / ~33 000 BF16 ULP on identical FP8 bytes). Falling back to the batch16 GEMV is the only safe answer when any of it is missing.
Fields§
§rows: usizePadded decode rows — the ctx n the CUDA-graph cache is keyed by.
n: u32Output width of this projection.
k: u32Contract width of this projection.
ldc: u32Output row pitch in BF16 ELEMENTS (n for a contiguous output).
out_capacity_bytes: usizeAllocated size of the output buffer, in bytes.
Implementations§
Source§impl DecodeW8a8Plan
impl DecodeW8a8Plan
Sourcepub fn contiguous(
rows: usize,
n: u32,
k: u32,
out_capacity_bytes: usize,
) -> Self
pub fn contiguous( rows: usize, n: u32, k: u32, out_capacity_bytes: usize, ) -> Self
A contiguous [rows, n] output (SSM in_proj_qkvz, SSM out_proj,
attention o_proj).
Sourcepub fn strided(
rows: usize,
n: u32,
k: u32,
ldc: u32,
out_capacity_bytes: usize,
) -> Self
pub fn strided( rows: usize, n: u32, k: u32, ldc: u32, out_capacity_bytes: usize, ) -> Self
A strided output: rows ldc BF16 elements apart (attention Q/K/V into
the [n, per_seq_qkv] multi-seq QKV buffer).
Sourcepub fn write_extent_bytes(&self) -> usize
pub fn write_extent_bytes(&self) -> usize
Bytes of out this projection may touch, phantom rows included.
Trait Implementations§
Source§impl Clone for DecodeW8a8Plan
impl Clone for DecodeW8a8Plan
Source§fn clone(&self) -> DecodeW8a8Plan
fn clone(&self) -> DecodeW8a8Plan
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DecodeW8a8Plan
impl Debug for DecodeW8a8Plan
impl Copy for DecodeW8a8Plan
Auto Trait Implementations§
impl Freeze for DecodeW8a8Plan
impl RefUnwindSafe for DecodeW8a8Plan
impl Send for DecodeW8a8Plan
impl Sync for DecodeW8a8Plan
impl Unpin for DecodeW8a8Plan
impl UnwindSafe for DecodeW8a8Plan
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