nx_nofloat_simd_dot_probe_gate.nx
buildroot/runtime/nx_nofloat_simd_dot_probe_gate.nx
about
nx_nofloat_simd_dot_probe_gate.nx -- DECISIVE probe for Stage 2 (SIMD decode). Before rebuilding the whole
decode around __i16x16_madd (vpmaddwd), answer three questions on representative data:
(1) does the W8A8 SIMD dot MATH work end-to-end (i16-lane pack2 store + vpmaddwd + i32x8 hsum + rescale)?
(2) how big is the quantization ERROR vs the exact i64 dot (the precision cost of the fork)?
(3) is it actually FASTER than the scalar i64 dot (the whole point)?
If error is small AND it's faster, wire into the real decode + measure token faithfulness. Else keep i32 lossless.
NOTE: nx_cc has NO i16 type -> i16 lanes are *u8 buffers with manual LE pack2 (as nx_nofloat_gemm does).
No hw writes (Rule 26). expect_exit: 0 license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.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
| none |
functions
| 12 | func sp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 13 | func sn(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); 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; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } |
| 14 | func iabs(v: i64) -> i64 { if v<0 { return 0-v } return v } |
| 17 | func hsum_sx(acc: *u8) -> i64 |
| 25 | func exact_dot(x: *i64, w: *i64, n: i64, shift: i64) -> i64 called by 1: main |
| 32 | func simd_w8a8_dot(x: *i64, w: *i64, xi: *u8, wi: *u8, acc: *u8, n: i64, shift: i64) -> i64 |
| 47 | func main() -> i64 |