IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /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. /get-started.md).

Mojo module

fp6_utils

Provides low-level FP6 encode/decode utilities and scale-factor helpers.

The FP6 twin of fp4_utils, covering both OCP MX FP6 encodings (E2M3 and E3M2). Neither FP6 encoding has Inf or NaN: all 64 codes are finite, so decode needs no special-case branch and encode saturates rather than propagating a non-finite input.

Both encodings share the MX block structure with MXFP4 -- 32 consecutive elements along K share one E8M0 scale -- so MXFP6_SF_VECTOR_SIZE matches its MXFP4 counterpart exactly.

comptime values​

E2M3_TO_FLOAT32​

comptime E2M3_TO_FLOAT32 = SIMD(SIMD(0), SIMD(0.125), SIMD(0.25), SIMD(0.375), SIMD(0.5), SIMD(0.625), SIMD(0.75), SIMD(0.875), SIMD(1), SIMD(1.125), SIMD(1.25), SIMD(1.375), SIMD(1.5), SIMD(1.625), SIMD(1.75), SIMD(1.875), SIMD(2), SIMD(2.25), SIMD(2.5), SIMD(2.75), SIMD(3), SIMD(3.25), SIMD(3.5), SIMD(3.75), SIMD(4), SIMD(4.5), SIMD(5), SIMD(5.5), SIMD(6), SIMD(6.5), SIMD(7), SIMD(7.5), SIMD(-0.0), SIMD(-0.125), SIMD(-0.25), SIMD(-0.375), SIMD(-0.5), SIMD(-0.625), SIMD(-0.75), SIMD(-0.875), SIMD(-1), SIMD(-1.125), SIMD(-1.25), SIMD(-1.375), SIMD(-1.5), SIMD(-1.625), SIMD(-1.75), SIMD(-1.875), SIMD(-2), SIMD(-2.25), SIMD(-2.5), SIMD(-2.75), SIMD(-3), SIMD(-3.25), SIMD(-3.5), SIMD(-3.75), SIMD(-4), SIMD(-4.5), SIMD(-5), SIMD(-5.5), SIMD(-6), SIMD(-6.5), SIMD(-7), SIMD(-7.5))

E3M2_TO_FLOAT32​

comptime E3M2_TO_FLOAT32 = SIMD(SIMD(0), SIMD(0.0625), SIMD(0.125), SIMD(0.1875), SIMD(0.25), SIMD(0.3125), SIMD(0.375), SIMD(0.4375), SIMD(0.5), SIMD(0.625), SIMD(0.75), SIMD(0.875), SIMD(1), SIMD(1.25), SIMD(1.5), SIMD(1.75), SIMD(2), SIMD(2.5), SIMD(3), SIMD(3.5), SIMD(4), SIMD(5), SIMD(6), SIMD(7), SIMD(8), SIMD(10), SIMD(12), SIMD(14), SIMD(16), SIMD(20), SIMD(24), SIMD(28), SIMD(-0.0), SIMD(-0.0625), SIMD(-0.125), SIMD(-0.1875), SIMD(-0.25), SIMD(-0.3125), SIMD(-0.375), SIMD(-0.4375), SIMD(-0.5), SIMD(-0.625), SIMD(-0.75), SIMD(-0.875), SIMD(-1), SIMD(-1.25), SIMD(-1.5), SIMD(-1.75), SIMD(-2), SIMD(-2.5), SIMD(-3), SIMD(-3.5), SIMD(-4), SIMD(-5), SIMD(-6), SIMD(-7), SIMD(-8), SIMD(-10), SIMD(-12), SIMD(-14), SIMD(-16), SIMD(-20), SIMD(-24), SIMD(-28))

MXFP6_SF_VECTOR_SIZE​

comptime MXFP6_SF_VECTOR_SIZE = 32

Structs​

  • ​FP6Format: Selects between the two OCP MX FP6 element encodings.

Functions​

Was this page helpful?