nx_q8_0_simd_gate.nx
buildroot/runtime/nx_q8_0_simd_gate.nx
about
nx_q8_0_simd_gate.nx -- does the SIMD __f32_i8dot32 fused Q8_0 dequant-dot
WIN? Q8_0 has NO nibble unpack (int8 directly), so the intrinsic applies
cleanly. lm_head is Q8_0 (136M values, 143ms in the forward, memory-bound).
Threaded Q8_0-fused vs F32-pool at ~lm_head shape (m=1, k=896, big n).
Ratio host-noise-tolerant. NO forward changes.
1 Q8_0-fused == F32-pool bit-exact (exact-int regime)
2 threaded ratio: WIN prints if >= 1.0x
lineage_id: q8_0_simd_gate_v1
dependencies 9 imports · 0 importers
imports: nx_syscalls.nxnx_tier.nxnx_le.nxnx_f32.nxnx_f32_cvt.nxnx_q8_0_to_f32.nxnx_thread_pool.nxnx_f32_matmul_t.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
| 27 | struct Q8Ctx { qbuf: i64, aptr: i64, cptr: i64, k: i64, n: i64, jlo: i64, jhi: i64 } |
consts
| 21 | const QK: i64 = 896 |
| 22 | const QN: i64 = 32768 |
| 23 | const QREPS: i64 = 60 |
| 24 | const Q8B: i64 = 34 |
| 25 | const Q8V: i64 = 32 |
| 28 | const Q8CTX_BYTES: i64 = 56 |
functions
| 30 | func q_lcg(s: i64) -> i64 { var v: i64 = s * 1103515245 + 12345; v = v & 2147483647; return v } |
| 32 | func q_fill_weight(w: *u8, seed: i64) -> i64 |
| 50 | func q_fill_a(p: *i64, count: i64, seed: i64) -> i64 |
| 57 | func q8_0_dot(qbuf: *u8, qoff: i64, Apk: *u8, k: i64) -> i64 |
| 73 | func q8_task(ctx_i: i64) -> i64 calls 1: q8_0_dot |
| 87 | func q8_pool_matmul(pool: *NxThreadPool, qbuf: *u8, Apk: *u8, C: *i64, k: i64, n: i64) -> i64 |
| 110 | func q_nl() -> i64 { fmt_puts("\n" as *u8); return 0 } |
| 112 | func main() -> i64 |