nx_dequant_bench.nx
buildroot/runtime/nx_dequant_bench.nx
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
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
| 34 | const NX_DB_N_BLOCKS: i64 = 64 // Q4_K super-blocks per run (= 16384 values) |
| 35 | const NX_DB_K_RUNS: i64 = 32 // benchmark iterations |
functions
| none |