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

compute_mxfp4_even_scale

def compute_mxfp4_even_scale(max_val: Float32) -> Float8_e8m0fnu

Computes the OCP MXFP4 E8M0 scale using even-mode rounding.

Even-mode rounding rounds the block maximum before deriving the scale exponent. This differs from ceil(max / 6) and preserves more precision for smaller values in the same 32-element block.

Returns:

Float8_e8m0fnu