code wiki / (root) / nx_dequant_bench.nx

nx_dequant_bench.nx

buildroot/runtime/nx_dequant_bench.nx

1531 B35 linesdepth 6pulls 11 transitivereach 1 importersview sourcekind benchtopic dequant
docsdependenciesstructsconstsfunctions

about

nx_dequant_bench.nx -- pure dequant throughput measurement. Earns its own numbers, claims nothing about other frameworks. Per the no-strawman-perf-comparisons feedback (2026-05-19): any "Nx faster" or "ratio" claim requires running BOTH sides on the same workload + hardware. This bench measures OUR Q4_K / Q8_0 / F32 dequant kernels. Comparing to llama.cpp / ggml requires running llama.cpp on the same hardware (deferred to Task #8). What this bench measures: * ns per dequantized value (avg over K runs) * MB/s input throughput (bytes-of-quantized-data / second) * Sanity check: output values not stuck at NX_GL_Q10_INF_SAT (catches catastrophic overflow / NaN propagation) Hardware caveat: this runs on qemu-riscv64-static (emulated RV64 on an x86_64 host). Numbers will be 5-20x slower than native because qemu user-mode dynamic translation costs overhead. Native RV64 silicon would be faster; native x86_64 (the actual deployment target) faster still. Report the qemu number AS the qemu number, not as "Nishi performance". genealogy_id: standard_microbench_harness + ggml_q4k_dequant_ref lineage_id: substrate_dequant_bench_v1

dependencies 6 imports · 1 importers

nx_syscalls.nx nx_tier.nx nx_le.nx nx_strconv.nx nx_gguf.nx nx_gguf_load.nx nx_dequant_bench.nx nx_dequant_bench_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_le.nxnx_strconv.nxnx_gguf.nxnx_gguf_load.nx

imported by: nx_dequant_bench_test.nx

structs

none

consts

34const NX_DB_N_BLOCKS: i64 = 64 // Q4_K super-blocks per run (= 16384 values)
35const NX_DB_K_RUNS: i64 = 32 // benchmark iterations

functions

none