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_layer0.py

18 lines · 958 bytes Raw Blame History
1import json,subprocess,sys,numpy as np,zlib,lzma,hashlib
2B='https://huggingface.co/Qwen/Qwen3.8-Flash-Next-FP8/resolve/main/'
3H=json.load(open('hdrs.json'))
4P='model.language_model.layers.0.mlp.experts.'
5def 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)
12ex=[int(x) for x in sys.argv[1:]]
13out={}
14for 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')
17np.savez('l0.npz',**out)
18print('saved',len(out),'sha256',hashlib.sha256(open('l0.npz','rb').read()).hexdigest())