code wiki / (root) / nx_q8_st_bw.nx

nx_q8_st_bw.nx

buildroot/runtime/nx_q8_st_bw.nx

2349 B65 linesdepth 10pulls 30 transitivereach 0 importersview sourcekind tooltopic q8
docsdependenciesstructsconstsfunctions

about

nx_q8_st_bw.nx -- SINGLE-THREAD sovereign Q8 matmul bandwidth, to split the 2.7x gap vs gcc-in-WSL2 (25.5 GB/s @16thr) into per-thread (kernel/memory) vs scaling (pool). gcc SINGLE-thread Q8 matmul in WSL2 = 2892 MB/s. If sovereign single-thread ~= 2892 -> the gap is THREADING SCALING (fix pool). If << 2892 -> per-thread kernel/memory. Cold 220MB sweep via the ST path.

dependencies 8 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_le.nx nx_f32.nx nx_f32_cvt.nx nx_thread_pool.nx nx_f32_lazy_weight.nx nx_fmt.nx nx_q8_st_bw.nx

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

main sys_mmap sb_lcg nx_i32_to_f32 nx_lw_shared_pool nx_pool_is_native sb_weight sys_mmap ↻ sb_lcg ↻ nx_f32_lazy_weight_new_q8_ sys_mmap ↻ sys_now_us sys_mmap ↻ sys_clock_gettime_mono _lw_q8_0_matmul_st _q8st_apk sys_mmap ↻ _fq4m_pack_a _lw_q8_0_dot nx_f16_to_f32 nx_le_read_u16 fmt_puts fmt_puts_fd sys_write fmt_putn fmt_putn_fd sys_write ↻ sb_nl fmt_puts ↻

structs

none

consts

15const MK: i64 = 896
16const NG: i64 = 4864
17const Q8B: i64 = 34
18const NB: i64 = 48 // 48 * 4.63MB = 222MB cold

functions

20func sb_nl() -> i64 { fmt_puts("\n" as *u8); return 0 }
called by 1: main calls 1: fmt_puts
21func sb_lcg(s: i64) -> i64 { var v: i64 = s * 1103515245 + 12345; v = v & 2147483647; return v }
called by 2: sb_weightmain
22func sb_weight(seed: i64) -> *NxF32LazyWeight
41func main() -> i64