Skip to main content

Fp8BlockScales

Struct Fp8BlockScales 

Source
pub struct Fp8BlockScales {
    pub scales: CudaSlice<f32>,
    pub rows: usize,
    pub cols: usize,
}
Expand description

Device-resident block-128 weight-scale grid for an e4m3 operand (B1b, lane fp8st 2026-08-03).

STORAGE LAYOUT (the canonical device layout every future consumer builds from): a flat f32 buffer in the CHECKPOINT’S on-disk order — row-major [rows = ceil(out_f/128), cols = ceil(in_f/128)], so scales[ob * cols + kb] scales the 128x128 weight tile at output-block ob, input-block kb (uploaded verbatim from memra_gguf::source::F8BlockGrid, no permutation — one host decode, one htod). Rationale: (1) the per-block-dequant mmvq twin (qmatvec_e4m3_mmvq extension, DECISION.md B1) indexes (o >> 7) * cols + (e >> 7) — natural in this order; (2) for cuBLASLt BLK128x128 the weight [out, in] row-major is the TN GEMM’s column-major [k=in, n=out] A operand, and this same linear order IS that view’s column-major block grid with ld = cols(=kblk) — probe P1 (probe/fp8_lt_blk_probe.cu) verifies whether sm_120 accepts it directly; if Lt wants a different order, the reorder happens at the GEMM plan build, NOT here. NO KERNEL CONSUMES THIS YET: the loader keeps every block-128 tensor’s decode/prefill on the Q8_0 re-encode until the consuming kernels land (try_fp8_gemm skips blk operands; the QT_F8_E4M3 one-copy arm rejects them). This struct’s job is bytes+scales resident and correct.

Fields§

§scales: CudaSlice<f32>§rows: usize§cols: usize

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, 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.