Read the equation
The encoded byte first becomes its FP8 numerical value in float32, then is multiplied by the scale shared by its 128-by-128 block. The block indices mean floor(r/128) and floor(c/128). A partial boundary block still requires a scale, so the scale-grid shape uses ceiling division. The companion tensor name weight_scale_inv does not change this multiplication rule; the official dequantization kernel confirms it.
Terms & definitions
| Term | Meaning in this source |
|---|---|
| W | Encoded weight tensor |
| S | Per-block scale grid |
| r | Row index |
| c | Column index |
How it works
Read the definition from its right-hand expression to the quantity on the left. Its surrounding source records the intended input, state, or parameter context. Where the source leaves an operation unspecified, this page preserves that gap.
Assumptions & limits
Source recovery establishes that the expression appears in this record. Its mathematical validity, implementation behavior, and interpretation must be assessed separately. See the linked source and research notes for the checks available for this version.
Original context
Read the surrounding source passage
For a weight tensor W of shape (R, C) with companion scale S of shape
(ceil(R/128), ceil(C/128)):
W_real[r][c] = fp8_to_f32( W[r][c] ) * S[ r/128 ][ c/128 ]
The scale is named "weight_scale_inv" but is applied by multiplication in the
standard fp8 kernels. Confirm the direction against a reference on a real cell
rather than inferring it from the name.Exact original notation
W_real[r][c] = fp8_to_f32( W[r][c] ) * S[ r/128 ][ c/128 ]
Related builds
Sources & provenance
W_real[r][c] = fp8_to_f32( W[r][c] ) * S[ r/128 ][ c/128 ]
W_real[r][c] = fp8_to_f32( W[r][c] ) * S[ r/128 ][ c/128 ]