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 / amd-speed-20261114 / raw / spec-decode / card-s4 / fake_launch.py
| 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 |
| 3 | checked the same plan and arguments under qemu. Prints the launcher's output format with reference ids (published AMD |
| 4 | ids for lighthouse plans, the driver's golden ids for coding24 plans), one token per pass for OMPLAN02 (n=1 a=0). |
| 5 | Controls (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""" |
| 7 | import json, os, struct, sys |
| 8 | from pathlib import Path |
| 9 | plan = Path(sys.argv[1]); raw = plan.read_bytes(); magic = raw[:8] |
| 10 | ng, npm = struct.unpack_from('<Q', raw, 48)[0], struct.unpack_from('<Q', raw, 40)[0] |
| 11 | here = Path(__file__).resolve().parent |
| 12 | ids = json.loads((here / ('published-ids.json' if ng == 256 else 'golden24.json')).read_text()) |
| 13 | if plan.parent.name.endswith('-ctl'): ids = ids[1:] + ids[:1] |
| 14 | if magic == b'OMPLAN02' and os.environ.get('FAKE_MUTANT') == '1': ids = ids[:128] + [ids[128] + 1] + ids[129:] |
| 15 | for 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 '')) |
| 18 | print('OMEGA_PLAN ids=[' + ','.join(map(str, ids)) + ']'); print('OMEGA_PLAN complete') |