code wiki / _hdl_build / nx_nofloat_mxfp8.nx
nx_nofloat_mxfp8.nx
buildroot/runtime/_hdl_build/nx_nofloat_mxfp8.nx
about
nx_nofloat_mxfp8.nx -- SOVEREIGN no-float MXFP8 dequant (K3 F406; operator 2026-07-19 "state of the art").
Completes the OCP Microscaling (MX v1.0) story begun in nx_nofloat_mxfp4: Kimi K3 uses MXFP4 WEIGHTS +
MXFP8 ACTIVATIONS. An MX block = 32 elements, each an 8-bit float sharing ONE E8M0 scale byte (value =
2^(e-127), 0xFF=NaN). Two OCP FP8 element formats:
E4M3: sign(1) exp(4,bias 7) mant(3) -- NO inf; max 448; NaN = E=1111,M=111; subnormal when E=0
E5M2: sign(1) exp(5,bias 15) mant(2) -- inf at E=11111,M=00; NaN at E=11111,M!=0; subnormal when E=0
Dequant is PURE INTEGER Q16: implicit-1 mantissa (1 + M/2^m) as Q16 + a combined power-of-2 shift of
(E - bias) + (scale_e - 127), sign applied. No float touches weights OR activations -> deterministic, the
novel no-float treatment. Grounded: OCP MX v1.0; arXiv 2310.10537. license_tier: ORIGINAL No hw (Rule 26).
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_nofloat_mxfp8_gate.nx
structs
| none |
consts
| 12 | const MX8_Q: i64 = 65536 |
| 13 | const MX8_NAN_SCALE: i64 = 255 // E8M0 0xFF = NaN block scale |
| 14 | const MX8_SBIAS: i64 = 127 // E8M0 bias |
| 15 | const MX8_BLK: i64 = 32 |
functions
| 18 | func mx8_shift(v: i64, sh: i64) -> i64 |
| 23 | func mx8_e4m3(byte: i64, scale_e: i64) -> i64 |
| 43 | func mx8_e5m2(byte: i64, scale_e: i64) -> i64 |
| 63 | func mx8_block_e4m3(buf: *u8, boff: i64, soff: i64, out: *i64) -> i64 |
| 70 | func mx8_block_e5m2(buf: *u8, boff: i64, soff: i64, out: *i64) -> i64 calls 1: mx8_e5m2 |