nx_nofloat_blockfloat_gemm_gate.nx
buildroot/runtime/nx_nofloat_blockfloat_gemm_gate.nx
about
nx_nofloat_blockfloat_gemm_gate.nx -- BLOCK-FLOAT weights through the no-float GEMM: the format earns its place
in the actual compute path (the rung after nx_nofloat_blockfloat_gate proved the format round-trips). The GEMM
computes DIRECTLY on the integer mantissas + per-block power-of-2 shifts (no dequant materialisation) --
C[m] = sum_over_K-blocks b ( (sum_{k in b} A[m][k]*q_W[k]) << e_b ). Proves:
1 the direct block-float GEMM == dequant-then-matmul, BYTE-EXACT (the on-mantissa compute is correct)
2 EXCEED (MEASURED): block-float matmul error vs full-precision < per-tensor INT8 matmul error
3 DETERMINISTIC: the block-float GEMM run twice is bit-identical (integer sums + shifts, no float)
4 per-tensor scaling ZEROED the small weight block (lost its whole matmul contribution); block-float kept it
expect_exit: 0 license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 13 | func bf_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 14 | func bf_putn(v: i64) -> i64 |
| 24 | func bf_chk(name: *u8, ok: i64) -> i64 |
| 28 | func bf_bitlen(x: i64) -> i64 { var b: i64 = 0; var m: i64 = x; while m > 0 { m = m >> 1; b = b + 1 } return b } called by 1: bf_scale |
| 29 | func bf_absdiff(a: i64, b: i64) -> i64 { if a >= b { return a - b } return b - a } called by 1: main |
| 30 | func bf_scale(v: *i64, off: i64, B: i64, M: i64) -> i64 |
| 39 | func mm(A: *i64, W: *i64, M: i64, K: i64, out: *i64) -> i64 called by 1: main |
| 50 | func bf_gemm(A: *i64, q_W: *i64, e_bf: *i64, M: i64, K: i64, B: i64, out: *i64) -> i64 called by 1: main |
| 66 | func main() -> i64 |