code wiki / (root) / nx_vit_speed_probe.nx

nx_vit_speed_probe.nx

buildroot/runtime/nx_vit_speed_probe.nx

2203 B41 linesdepth 4pulls 7 transitivereach 0 importersview sourcekind probe
docsdependenciesstructsconstsfunctions

about

nx_vit_speed_probe.nx -- measure the software-f32 matmul rate (MAC/s) to decide if a FAITHFUL f32 ViTPose forward is viable or if the port must ride the int8 path. Times one GEMM A[32,512]@B[512,512] (8.4M MACs) and extrapolates to a full ViTPose-base forward (~17.5 GMAC: patch-embed + 12x[QKV+attn+dense+fc1+fc2] + head conv). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_f32_cvt.nx nx_f32_matmul.nx nx_vit_speed_probe.nx

imports: nx_syscalls.nxnx_f32_cvt.nxnx_f32_matmul.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap nx_i32_to_f32 sys_now_us sys_mmap ↻ sys_clock_gettime_mono nx_f32_matmul w sys_write wn w ↻ sys_mmap ↻ sys_write ↻ sys_exit

structs

none

consts

7const K_MAGIC_1000000: i64 = 1000000
8const K_MAGIC_17500000000: i64 = 17500000000

functions

10func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 2: wnmain calls 1: sys_write
11func wn(v: i64) -> i64 { var m: i64=v; if m<0{w("-" as *u8);m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i:i64=0; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 }
called by 1: main calls 3: wsys_mmapsys_write
13func main() -> i64