interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / evidence / FLASH-NEXT-WEIGHT-WASTE-20261118 / run.py

12 lines · 675 bytes Raw Blame History
1import numpy as np,subprocess,sys,hashlib,os
2tot=[0,0]; ok=True; bad=0; nt=0
3for f in sys.argv[1:]:
4 Z=np.load(f)
5 for k in Z.files:
6 if k.endswith('.s'): continue
7 a=Z[k]; a.tofile('t.raw'); r,c=a.shape
8 n,z,rt=map(int,subprocess.check_output(['./rowrans','t.raw',str(r),str(c)]).split())
9 n2,z2,rt2=map(int,subprocess.check_output(['./rowrans','t.raw',str(r),str(c),'flip']).split())
10 tot[0]+=n; tot[1]+=z; ok&=(rt==1); bad+=(rt2==0); nt+=1
11os.remove('t.raw')
12print(f'tensors={nt} raw={tot[0]} coded={tot[1]} bits/weight={8*tot[1]/tot[0]:.4f} ratio={tot[1]/tot[0]:.4f} all_roundtrip_bit_exact={ok} flipped_bit_detected={bad}/{nt}')