Expand description
2026-09-25: Host-side numeric conversions: the FP8 E4M3 decode table, the f32 -> BF16 cast and BF16 widening.
Owner: metrale-core. Invariants:
- No CUDA and no
cfg: the module compiles under every feature combination. FP8_E4M3_LUTdecodes the two NaN bytes (0x7F,0xFF) to signed zero.E4M3_LUT_GMOEinkernels/gb10/common/moe_fp8_grouped_gemm.cumust agree withFP8_E4M3_LUTelement for element; it does, including the signed zeros.
Statics§
- FP8_
E4M3_ LUT - 2026-09-25: FP8 E4M3 -> f32 lookup table, one entry per byte value.
Functions§
- bf16_
bytes_ to_ f32 - 2026-09-25: Widen little-endian BF16 bytes to f32. Exact: BF16 is the top 16 bits of an f32, so this is a shift, never a rounding.
- f32_
to_ bf16 - 2026-09-25: Convert f32 to BF16 with IEEE-754 round-to-nearest-even.
- fp8_
e4m3_ to_ f32 - 2026-09-25: Decode one FP8 E4M3 byte to f32 with a single table load.