Skip to main content

Mojo function

compute_mxfp4_even_scale

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

Was this page helpful?