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 / amd-speed-20261114 / raw / spec-decode / card-s4 / fake_launch.py

18 lines · 1316 bytes Raw Blame History
1#!/usr/bin/env python3
2"""spec-decode S4 DRY rehearsal only (never in a card run): stands in for the launcher after the real launchers have
3checked the same plan and arguments under qemu. Prints the launcher's output format with reference ids (published AMD
4ids for lighthouse plans, the driver's golden ids for coding24 plans), one token per pass for OMPLAN02 (n=1 a=0).
5Controls (plan directory ending -ctl) print the ids shifted by one. FAKE_MUTANT=1: OMPLAN02 runs print id 128 wrong.
6 fake_launch.py PLAN ARGS... TIMEOUT_NS"""
7import json, os, struct, sys
8from pathlib import Path
9plan = Path(sys.argv[1]); raw = plan.read_bytes(); magic = raw[:8]
10ng, npm = struct.unpack_from('<Q', raw, 48)[0], struct.unpack_from('<Q', raw, 40)[0]
11here = Path(__file__).resolve().parent
12ids = json.loads((here / ('published-ids.json' if ng == 256 else 'golden24.json')).read_text())
13if plan.parent.name.endswith('-ctl'): ids = ids[1:] + ids[:1]
14if magic == b'OMPLAN02' and os.environ.get('FAKE_MUTANT') == '1': ids = ids[:128] + [ids[128] + 1] + ids[129:]
15for s in range(npm + ng - 1):
16 tok = ids[s - npm + 1] if s >= npm - 1 else 0
17 print(f'OMEGA_STEP {s} tok={tok} us={26000 + s}' + (' n=1 a=0' if magic == b'OMPLAN02' else ''))
18print('OMEGA_PLAN ids=[' + ','.join(map(str, ids)) + ']'); print('OMEGA_PLAN complete')