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 / fetch_layers.py

19 lines · 1080 bytes Raw Blame History
1import json,subprocess,struct,sys,numpy as np,hashlib
2B='https://huggingface.co/Qwen/Qwen3.8-Flash-Next-FP8/resolve/main/'
3ix=json.load(open('index.json'))['weight_map']
4def get(u,*a): return subprocess.run(['curl','-sS','-L','-m','300','--retry','3',*a,u],capture_output=True).stdout
5hc={}
6def 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]
10out={}
11for 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'])
19np.savez('lx.npz',**out); print('sha256',hashlib.sha256(open('lx.npz','rb').read()).hexdigest())