nx_q5k_dot_simd.nx
buildroot/runtime/nx_q5k_dot_simd.nx
about
nx_q5k_dot_simd.nx -- SIMD-accelerated Q5_K fused dot (vpmaddwd), bit-exact vs a scalar Q5_K dot.
Extends the perf-exceed to the Q5_K layer matmuls (attn_v/output/ffn_down). Q5_K = Q4_K + a 5th bit from
qh: q5 = q4 + (qh_bit ? 16 : 0). Reformulation is the same: dot += d1*sq - m0*sc, sq = Σ q5*col via
vpmaddwd (q5 i16 0..31, col i16 Q10). Read-once + sc-precompute like nx_q4k_dot_simd. Includes an inline
scalar Q5_K dot as the bit-exact oracle. Verified on real blk.0.attn_v + measured.
license_tier: ORIGINAL
dependencies 11 imports · 0 importers
diagram shows first 10 each side; +1 more imports, +0 more importers in the complete lists below.
imports: nx_syscalls.nxnx_tier.nxnx_le.nxnx_strconv.nxnx_tensor.nxnx_gguf.nxnx_gguf_load.nxnx_gguf_meta.nxnx_placement.nxnx_gguf_load_lazy.nxnx_clock.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
| 20 | func q5s_pack4(a: i64, b: i64, c: i64, d: i64) -> i64 called by 1: main |
| 24 | func q5s_hsum(acc: *i64) -> i64 called by 1: q5k_dot_simd |
| 40 | func q5s_scmin(buf: *u8, scales_off: i64, j: i64, out: *i64) -> i64 |
| 53 | func q5k_dot_scalar(buf: *u8, base_off: i64, n_blocks: i64, col_q10: *i64, sm: *i64) -> i64 |
| 97 | func q5k_dot_simd(buf: *u8, base_off: i64, n_blocks: i64, col_i16: *i64, |
| 157 | func q5s_emit(fd: i64, key: *u8, kl: i64, v: i64) -> i64 |
| 171 | func main() -> i64 |