IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo function

fp8_materialize_kernel

def fp8_materialize_kernel[out_type: DType, w_layout: TensorLayout, out_layout: TensorLayout](out_w: TileTensor[out_type, out_layout, MutAnyOrigin], weight: TileTensor[DType.float8_e4m3fn, w_layout, ImmutAnyOrigin])

Materializes the FP8 weight into a dense [N, K] out_type buffer.

One thread per output element (n, k): out_w[n, k] = W_fp8[n, k] widened to out_type (E4M3 -> out_type, exact for out_type = bf16; bf16 represents every E4M3 value exactly). The M>1 interim path of enqueue_apple_fp8_matmul dequantizes the weight so the EXISTING dense bf16 AppleM5MatMul can consume it (the per-tensor weight_scale is folded post-matmul by the graph lowering, identically to the GEMV path). The FP8 sibling of fp4_materialize_kernel, minus the nibble unpack + block scale.

Was this page helpful?