nx_q8_coldwarm.nx
buildroot/runtime/nx_q8_coldwarm.nx
about
nx_q8_coldwarm.nx -- decides the post-futex decode-matmul direction:
COMPUTE-bound (kernel work: AVX2/multi-acc pays) vs COLD-STREAMING-bound
(fewer bytes / batch tokens pays). Measures the SAME production Q8_0
matmul two ways at FULL-MODEL working-set scale (~209MB, like the real
forward's 24 distinct layers read once/token):
WARM = one weight buffer, REPS reps (cache-resident after pass 1).
COLD = NB DISTINCT buffers (aggregate >> LLC), one matmul each, never
reused (the forward's true access pattern).
COLD/WARM ~1 -> compute-bound (kernel is the lever).
COLD/WARM >>1 -> cold DRAM streaming (fewer bytes / batch is the lever).
license_tier: ORIGINAL expect_exit: 0
dependencies 8 imports · 0 importers
imports: nx_syscalls.nxnx_tier.nxnx_le.nxnx_f32.nxnx_f32_cvt.nxnx_thread_pool.nxnx_f32_lazy_weight.nxnx_fmt.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
| 21 | const MK: i64 = 896 |
| 22 | const NG: i64 = 4864 // W_gate width; one buf = 896*4864*34/32 = 4.63MB |
| 23 | const Q8B: i64 = 34 |
| 24 | const Q8V: i64 = 32 |
| 25 | const NB: i64 = 48 // 48 * 4.63MB = 222MB ~ full model, >> LLC |
functions
| 27 | func cw_nl() -> i64 { fmt_puts("\n" as *u8); return 0 } |
| 28 | func cw_lcg(s: i64) -> i64 { var v: i64 = s * 1103515245 + 12345; v = v & 2147483647; return v } |
| 29 | func cw_weight(seed: i64) -> *NxF32LazyWeight |
| 47 | func cw_rep(tag: *u8, us: i64, calls: i64) -> i64 |
| 60 | func main() -> i64 |