Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/blob/main/docs/models/MXFP4.md # CUDApp CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / docs / models / MXFP4.md` 45 lines · 2574 bytes Raw Blame History Rendered 1 2 # MXFP4 dequantisation unit 3 4 `native/models/mxfp4.om` turns one MXFP4 element into exact IEEE binary32 bits. An MXFP4 element is an E2M1 nibble together with the E8M0 scale of its 32-element block. This is the format gpt-oss stores its MoE expert weights in. 5 6 - `mxfp4bits nib scale` takes a nibble (0..15) and a biased scale (0..254) and returns the float bits. 7 - `mxfp4byte packed lane scale` takes a packed byte and selects the low nibble (lane 0) or the high nibble (lane 1). The low nibble comes first, as in gpt-oss. 8 - The functions return integer bits, not floats, so the same integer code can be lowered by every Omega back end. 9 - Refusals trap 5, which gives process exit 105. They cover a nibble above 15, a lane above 1, a packed value above 255 and the reserved E8M0 scale 255 (a NaN block). 10 - Results the format cannot represent finitely become signed infinity. Signed zero is preserved. Results below the normal range become subnormals. 11 12 It is a scalar primitive, not a GEMM and not an inference engine, and it does not touch any device. 13 14 ## Check 15 16 ``` 17 python3 tests/models/mxfp4-check.py 18 ``` 19 20 `` must be the seed-built compiler with sha256 ``189ada82e00bb440cb41351bd252cc68c54a1b1050051cc42a1df700081c3b54`` (omega-mv ``91b3c932``); the script refuses any other. 21 22 What the script does: 23 - Compiles the unit with `tests/models/mxfp4-driver.om` to a native AArch64 program. 24 - Compares every input (255 scales × 256 bytes × 2 lanes = 130560 records) byte for byte against an oracle. The oracle uses `FP4_VALUES` from `openai/gpt-oss` `gpt_oss/torch/weights.py`, `math.ldexp` and `struct.pack('