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_layers.py
| 1 | import json,subprocess,struct,sys,numpy as np,hashlib |
| 2 | B='https://huggingface.co/Qwen/Qwen3.8-Flash-Next-FP8/resolve/main/' |
| 3 | ix=json.load(open('index.json'))['weight_map'] |
| 4 | def get(u,*a): return subprocess.run(['curl','-sS','-L','-m','300','--retry','3',*a,u],capture_output=True).stdout |
| 5 | hc={} |
| 6 | def hdr(sh): |
| 7 | if sh not in hc: |
| 8 | n=struct.unpack('<Q',get(B+sh,'-r','0-7'))[0]; hc[sh]=(n,json.loads(get(B+sh,'-r',f'8-{7+n}'))) |
| 9 | return hc[sh] |
| 10 | out={} |
| 11 | for L in (11,24,47): |
| 12 | for e in (5,130,409): |
| 13 | for m in ('gate_proj','up_proj','down_proj'): |
| 14 | for suf,dt in (('weight',np.uint8),('weight_scale_inv',np.uint16)): |
| 15 | name=f'model.language_model.layers.{L}.mlp.experts.{e}.{m}.{suf}' |
| 16 | n,h=hdr(ix[name]); a,b=h[name]['data_offsets']; o=8+n |
| 17 | d=get(B+ix[name],'-r',f'{o+a}-{o+b-1}'); assert len(d)==b-a |
| 18 | out[f'{L}_{e}.{m}'+('' if suf=='weight' else '.s')]=np.frombuffer(d,dtype=dt).reshape(h[name]['shape']) |
| 19 | np.savez('lx.npz',**out); print('sha256',hashlib.sha256(open('lx.npz','rb').read()).hexdigest()) |