nx_gpu_bench.nx
buildroot/runtime/nx_gpu_bench.nx
about
nx_gpu_bench.nx -- SOVEREIGN three-way GPU-compute benchmark harness: OURS vs CUDA vs Vulkan,
the no-wave measured-exceed instrument (operator 2026-06-20: "vm test ours vs cuda vs vulkan ...
test all three on this machine" + "how does unsloth or other tools do this").
METHODOLOGY (grounded in how Unsloth / llama-bench / the kernel-bench world actually measure):
- WARMUP before timing; MANY reps, report the MEDIAN(p50)+P95 (nx_bench_stats); GPU-clock timing for
GPU lanes / monotonic-ns here; CORRECTNESS IS A GATE (a faster-but-wrong lane is DISQUALIFIED);
report ABSOLUTE numbers + full config.
ROLE: this sovereign harness is the JUDGE/AGGREGATOR. It runs the sovereign lanes (a naive FP32 ref that
self-validates the instrument + the REAL fast integer-SIMD GEMM = __i16x16_madd, DETERMINISTIC), INGESTS
the incumbent yardstick results (gpu_bench_cuda.out = cuBLAS FP32+BF16), and writes the unified
scoreboard + honest verdict. The integer lane proves the DETERMINISM EXCEED: bit-exact (scalar==SIMD),
which cuBLAS float CANNOT be. NO fake greens. license_tier: ORIGINAL
dependencies 7 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_lib.nxnx_runtime.nxnx_clock.nxnx_tier.nxnx_bench_stats.nxnx_nofloat_gemm.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
| 22 | const GB_MAGIC_65536: i64 = 65536 |
| 23 | const GB_MAGIC_65535: i64 = 65535 |
| 25 | const GB_TSV: *u8 = "knowledge/status/gpu_bench.tsv" |
| 26 | const GB_LOG: *u8 = "knowledge/status/gpu_bench.log" |
| 27 | const GB_CUDA_OUT: *u8 = "knowledge/status/gpu_bench_cuda.out" |
functions
| 30 | func gb_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 35 | func gb_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 } |
| 36 | func gb_p(s: *u8) -> i64 { return gb_w(1, s) } |
| 37 | func gb_pn(v: i64) -> i64 { return gb_wn(1, v) } |
| 39 | func gb_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 52 | func gb_has(buf: *u8, n: i64, pat: *u8, pl: i64) -> i64 called by 1: main |
| 66 | func gb_init(N: i64, A: *i64, B: *i64) -> i64 called by 1: main |
| 75 | func gb_gemm(N: i64, A: *i64, B: *i64, C: *i64) -> i64 called by 1: main |
| 95 | func main() -> i64 |