Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/blob/main/evidence/FLASH-NEXT-CODER-FULL-20261118/fullcover.py # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / evidence / FLASH-NEXT-CODER-FULL-20261118 / fullcover.py` 81 lines · 3774 bytes Raw Blame History 1 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 # fullcover.py: run the rowrans measurement coder over EVERY routed-expert weight matrix of a local 3 # Qwen3.8-Flash-Next-FP8 checkpoint. Measuring instrument only (host, CPU, sizes; no timing claim). 4 # usage: python3 -I fullcover.py MODEL_DIR ROWRANS_BIN OUT_DIR WORKERS [INDEX_JSON] 5 # One JSONL per shard in OUT_DIR (resumable); waits for shards that are still downloading 6 # (a shard is ready when its file exists and no .aria2 control file is beside it). 7 import json, mmap, os, struct, subprocess, sys, time 8 from concurrent.futures import ProcessPoolExecutor 9 10 MODEL, ROWRANS, OUT, WORKERS = sys.argv[1], sys.argv[2], sys.argv[3], int(sys.argv[4]) 11 12 13 def is_expert_weight(k, v): 14 return '.mlp.experts.' in k and k.endswith('.weight') and v['dtype'] == 'F8_E4M3' 15 16 17 def do_shard(sh): 18 path = os.path.join(MODEL, sh) 19 dst = os.path.join(OUT, sh + '.jsonl') 20 tmp = f'/dev/shm/fullcover-{os.getpid()}.raw' 21 rows = [] 22 with open(path, 'rb') as f: 23 n = struct.unpack(' 5 else os.path.join(MODEL, 'model.safetensors.index.json') 58 print('index_sha256', __import__('hashlib').sha256(open(index, 'rb').read()).hexdigest(), flush=True) 59 ix = json.load(open(index))['weight_map'] 60 shards = sorted(set(ix.values())) 61 pending = [s for s in shards if not os.path.exists(os.path.join(OUT, s + '.jsonl'))] 62 print('shards', len(shards), 'pending', len(pending), flush=True) 63 with ProcessPoolExecutor(WORKERS) as ex: 64 running = {} 65 while pending or running: 66 for s in list(pending): 67 p = os.path.join(MODEL, s) 68 if len(running) < WORKERS * 2 and os.path.exists(p) and not os.path.exists(p + '.aria2'): 69 running[s] = ex.submit(do_shard, s) 70 pending.remove(s) 71 for s, fut in list(running.items()): 72 if fut.done(): 73 sh, nrows = fut.result() 74 print('done', sh, nrows, 'left', len(pending) + len(running) - 1, flush=True) 75 del running[s] 76 time.sleep(2) 77 print('ALL_SHARDS_DONE', flush=True) 78 79 80 if __name__ == '__main__': 81 main()