nx_nofloat_blockfloat_layer_gate.nx
buildroot/runtime/nx_nofloat_blockfloat_layer_gate.nx
about
nx_nofloat_blockfloat_layer_gate.nx -- BLOCK-FLOAT weights through a real LINEAR LAYER (W.x + bias -> ReLU),
the rung after the bare GEMM: a genuine weight MATRIX (OUT x IN, mixed-magnitude rows) quantized block-float
per-row-per-block, run through bias + activation. Proves the dynamic-range win + determinism survive a real
layer (the core of FFN + attention projections).
1 block-float layer (computed on mantissas) == dequant-then-layer, BYTE-EXACT
2 EXCEED (MEASURED): block-float layer error vs full-precision < per-tensor INT8 layer error
3 DETERMINISTIC: the block-float layer run twice == bit-identical
4 per-tensor scaling ZEROED a row's small block; block-float kept it (the super-weight fix, in a layer)
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_relu(x: i64) -> i64 { if x < 0 { return 0 } return x } |
| 31 | func bf_scale(W: *i64, off: i64, B: i64, M: i64) -> i64 |
| 40 | func fp_layer(W: *i64, x: *i64, bias: *i64, OUT: i64, IN: i64, out: *i64) -> i64 |
| 51 | func bf_layer(q_W: *i64, e_bf: *i64, x: *i64, bias: *i64, OUT: i64, IN: i64, B: i64, out: *i64) -> i64 |
| 69 | func main() -> i64 |