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
CUDApp / evidence / FLASH-NEXT-WEIGHT-WASTE-20261118 / fetch_layer0.py
| 1 | import json,subprocess,sys,numpy as np,zlib,lzma,hashlib |
| 2 | B='https://huggingface.co/Qwen/Qwen3.8-Flash-Next-FP8/resolve/main/' |
| 3 | H=json.load(open('hdrs.json')) |
| 4 | P='model.language_model.layers.0.mlp.experts.' |
| 5 | def fetch(name): |
| 6 | for sh,(n,h) in H.items(): |
| 7 | if name in h: |
| 8 | a,b=h[name]['data_offsets']; o=8+n |
| 9 | d=subprocess.run(['curl','-sS','-L','-m','300','--retry','3','-r',f'{o+a}-{o+b-1}',B+sh],capture_output=True).stdout |
| 10 | assert len(d)==b-a,(name,len(d)); return np.frombuffer(d,dtype=np.uint8 if h[name]['dtype']=='F8_E4M3' else np.uint16).reshape(h[name]['shape']) |
| 11 | raise KeyError(name) |
| 12 | ex=[int(x) for x in sys.argv[1:]] |
| 13 | out={} |
| 14 | for e in ex: |
| 15 | for m in ('gate_proj','up_proj','down_proj'): |
| 16 | out[f'{e}.{m}']=fetch(f'{P}{e}.{m}.weight'); out[f'{e}.{m}.s']=fetch(f'{P}{e}.{m}.weight_scale_inv') |
| 17 | np.savez('l0.npz',**out) |
| 18 | print('saved',len(out),'sha256',hashlib.sha256(open('l0.npz','rb').read()).hexdigest()) |