code wiki / (root) / nx_q4k_speed_bench.nx

nx_q4k_speed_bench.nx

buildroot/runtime/nx_q4k_speed_bench.nx

4749 B121 linesdepth 8pulls 20 transitivereach 0 importersview sourcekind benchtopic q4k
docsdependenciesstructsconstsfunctions

about

nx_q4k_speed_bench.nx -- measure the CPU speedup of the integer fused-dequant-dot vs emulated-f32. sd-server -> Nishi migration (CPU perf payoff). Both paths now agree with ggml (dequant tech debt fixed). This times, on the real blk.0.attn_q Q4_K weight row (4096), N iterations of: (A) INTEGER: nx_q4k_dot_row_col (fused dequant + integer-Q34 dot; the SOTA quantized-GEMM route). (B) F32: nx_q4k_to_f32 (dequant to f32) + emulated-f32 dot (the correctness route). Activation is converted to f32 ONCE outside the timed loop (amortized in a real GEMM), so we compare the per-output-neuron cost fairly. Reports us/op each and the speedup x100. license_tier: ORIGINAL

dependencies 16 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_le.nx nx_strconv.nx nx_tensor.nx nx_gguf.nx nx_gguf_load.nx nx_gguf_meta.nx nx_placement.nx nx_gguf_load_lazy.nx nx_q4k_speed_bench.nx

diagram shows first 10 each side; +6 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_q4k_matmul.nxnx_dequant_iter.nxnx_q4k_to_f32.nxnx_f32.nxnx_f32_cvt.nxnx_clock.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_openat_rd sys_mmap sys_read sys_close nx_gguf_parse nx_le_read_u32 nx_le_read_u64 nx_le_read_u32 ↻ _gguf_skip_value nx_le_read_u64 ↻ nx_le_read_u32 ↻ _gguf_skip_value ↻ sys_mmap ↻ nx_gguf_find_tensor nx_gguf_tensor_at nx_gguf_name_equals nx_gguf_tensor_at ↻ nx_q10_to_f32 nx_i32_to_f32 nx_q4k_iter_alloc sys_mmap ↻ nx_q4k_dot_row_col nx_q4k_iter_init nx_le_read_u16 _gguf_f16_to_q24 nx_le_read_u8 nx_q4k_iter_scale _q4k_iter_scale_at nx_q4k_iter_min _q4k_iter_min_at nx_le_read_u8 ↻ nx_q4k_to_f32 nx_q4k_block_to_f32 nx_le_read_u16 ↻ nx_f16_to_f32 nx_le_read_u8 ↻ nx_i32_to_f32 ↻ nx_clock_monotonic_ns sys_mmap ↻

structs

none

consts

none

functions

27func sb_emit(fd: i64, key: *u8, key_len: i64, value: i64) -> i64
41func main() -> i64