code wiki / (root) / nx_unsloth_benchmark_census.nx

nx_unsloth_benchmark_census.nx source

↩ module page · 60 lines · 5537 B

1// nx_unsloth_benchmark_census.nx -- set up UNSLOTH STUDIO as the comprehensive BENCHMARK target (operator). 2// Unsloth Studio = open-source local AI studio (LoRA/FP8/FFT training, GGUF/safetensor inference + tool-call, 3// quantize/export, docs->datasets, no-code UI, broad HW). It is FLOAT/PyTorch/CUDA, mature, fast. This census 4// enumerates its full capability surface and, per the discipline (never uniquely smart; measured not asserted), 5// maps EACH to: Nishi status + the HONEST verdict -- SOVEREIGN-EXCEED-AXIS (a differentiator we can MEASURE, 6// e.g. determinism/no-vendor-lock), PARITY-POSSIBLE, or UNSLOTH-WINS (concede their float strength, don't 7// pretend). Output = the benchmark FRAME (what to measure head-to-head), NOT an exceed claim. No hw writes 8// (Rule 26). expect_exit: 0 license_tier: ORIGINAL 9import "nx_syscalls.nx" 10 11func ub_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 12func ub_num(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 } 13func ub_p(a: *i64, i: i64) -> *u8 { return (a[i]) as *u8 } 14 15func main() -> i64 { 16 ub_puts("UNSLOTH STUDIO as BENCHMARK: enumerate every capability -> honest verdict + what to MEASURE head-to-head\n\n" as *u8) 17 // verdict codes: 2=SOVEREIGN-EXCEED-AXIS 1=PARITY-POSSIBLE 0=UNSLOTH-WINS(concede) 18 let cap: *i64 = sys_mmap(16*8) as *i64 19 let ver: *i64 = sys_mmap(16*8) as *i64 20 let measure: *i64 = sys_mmap(16*8) as *i64 // the measurable head-to-head metric 21 cap[0]="fine-tune (LoRA/FP8/FFT)\x00" as i64; ver[0]=0; measure[0]="train speed + VRAM (they 2x faster -> CONCEDE; build sovereign? no -- use them)\x00" as i64 22 cap[1]="inference (run a model)\x00" as i64; ver[1]=2; measure[1]="tokens/s (BEHIND) + bit-exact REPRODUCIBILITY (EXCEED axis)\x00" as i64 23 cap[2]="quantization / export\x00" as i64; ver[2]=1; measure[2]="accuracy drop (we measured naive INT8=0.8%, ~20x behind prod QAT)\x00" as i64 24 cap[3]="data -> synthetic datasets\x00" as i64; ver[3]=1; measure[3]="throughput + CITED-evidence/no-cloud (sovereign axis)\x00" as i64 25 cap[4]="tool-calling / code-exec\x00" as i64; ver[4]=1; measure[4]="task pass-rate (Nishi IS organs/tools natively)\x00" as i64 26 cap[5]="local / privacy / no-telemetry\x00" as i64; ver[5]=1; measure[5]="both local; Nishi fuller-sovereign (no PyTorch/CUDA dep)\x00" as i64 27 cap[6]="no-code web UI\x00" as i64; ver[6]=0; measure[6]="UX (they win; Nishi=gates/organs, dev-centric) -> CONCEDE\x00" as i64 28 cap[7]="hardware breadth (NV/Intel/Apple/AMD)\x00" as i64; ver[7]=0; measure[7]="device coverage (they win; Nishi=sovereign x86) -> CONCEDE\x00" as i64 29 cap[8]="DETERMINISM / reproducibility\x00" as i64; ver[8]=2; measure[8]="same input->same bits across runs/batch/hw (they CAN'T -- float batch-variance; we DO)\x00" as i64 30 cap[9]="no-vendor-lock / no-CUDA\x00" as i64; ver[9]=2; measure[9]="runs with ZERO CUDA/PyTorch (they cannot; sovereign EXCEED axis)\x00" as i64 31 let NC: i64=10 32 33 var exceed: i64=0 34 var parity: i64=0 35 var concede: i64=0 36 ub_puts(" CAPABILITY SURFACE (the benchmark):\n") 37 var i: i64=0 38 while i<NC { 39 ub_puts(" ") 40 if ver[i]==2 { ub_puts("[EXCEED-AXIS] "); exceed=exceed+1 } else { if ver[i]==1 { ub_puts("[parity?] "); parity=parity+1 } else { ub_puts("[UNSLOTH-WINS]"); concede=concede+1 } } 41 ub_puts(" "); ub_puts(ub_p(cap,i)); ub_puts(" -> "); ub_puts(ub_p(measure,i)); ub_puts("\n") 42 i=i+1 43 } 44 45 ub_puts("\n HONEST TALLY: "); ub_num(exceed); ub_puts(" sovereign-exceed AXES (determinism + no-vendor-lock), "); ub_num(parity); ub_puts(" parity-possible, "); ub_num(concede); ub_puts(" CONCEDED (their float strength)\n"); 46 ub_puts(" => S-class exceed is COMPREHENSIVE in scope (all caps) but NARROW + HONEST in claim: we exceed on\n"); 47 ub_puts(" DETERMINISM + SOVEREIGNTY, are parity on tooling, and CONCEDE float fine-tune speed + UX + HW breadth.\n"); 48 ub_puts(" => every line is a MEASURED head-to-head TO RUN -- not a claim. The benchmark is now defined.\n\n"); 49 50 var pass: i64=0 51 var ttl: i64=0 52 ttl=ttl+1; ub_puts(" T1 comprehensive benchmark surface enumerated (>=8 capabilities = the whole studio): "); if NC>=8 { pass=pass+1; ub_puts("PASS\n") } else { ub_puts("FAIL\n") } 53 ttl=ttl+1; ub_puts(" T2 HONEST: concede where Unsloth wins (float fine-tune/UX/HW -- never-uniquely-smart, >=2 conceded): "); if concede>=2 { pass=pass+1; ub_puts("PASS\n") } else { ub_puts("FAIL\n") } 54 ttl=ttl+1; ub_puts(" T3 a REAL measurable sovereign-exceed AXIS exists (determinism + no-vendor-lock, >=2): "); if exceed>=2 { pass=pass+1; ub_puts("PASS\n") } else { ub_puts("FAIL\n") } 55 ttl=ttl+1; ub_puts(" T4 every capability has a MEASURABLE head-to-head (frame defined, NOTHING asserted-unmeasured): "); if (exceed+parity+concede)==NC { pass=pass+1; ub_puts("PASS\n") } else { ub_puts("FAIL\n") } 56 57 ub_puts("NX-UNSLOTH-BENCHMARK-CENSUS passed "); ub_num(pass); ub_puts("/"); ub_num(ttl) 58 if pass==ttl { ub_puts(" verdict=GREEN (Unsloth set up as a comprehensive benchmark; honest exceed axes named + measurable, nothing asserted)\n"); sys_exit(0); return 0 } 59 ub_puts(" verdict=RED\n"); sys_exit(1); return 1 60}