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 / recompute / baseline.py

56 lines · 4212 bytes Raw Blame History
1#!/usr/bin/env python3
2# Baseline: the published run (10:12 UTC) and the same-session repeat (18:50 UTC session), from raw stdout captures.
3import json, statistics
4from common import ROOT, Book, omega_run, first_difference
5
6b = Book('baseline')
7PUB = 'amd-launch-gap/src/CUDApp-base/evidence/amd-qwen38-native-refusal-20261113' # CUDApp dc536882 clone
8REP = 'card-evidence'
9
10pub = [omega_run(ROOT / f'{PUB}/native/sample{i}.stdout') for i in range(1, 6)]
11pub_ids = pub[0]['ids']
12b.check('published 5 runs x 285 steps', all(r['steps'] == 285 for r in pub))
13b.check('published ids equal across runs', all(r['ids'] == pub_ids for r in pub))
14b.check('published 256 ids', len(pub_ids) == 256)
15meds = [round(r['decode_ms_median'], 3) for r in pub]
16b.add('published.run_medians', meds, 'ms/token', 'MEASURED', [f'{PUB}/native/sample{i}.stdout' for i in range(1, 6)],
17 'median of the 255 OMEGA_STEP us values after the 30 prompt steps, per run')
18pm = b.add('published.decode_ms', round(statistics.median(meds), 3), 'ms/token', 'MEASURED',
19 [f'{PUB}/native/sample{i}.stdout' for i in range(1, 6)], 'median of the five run medians')
20calc = json.loads((ROOT / f'{PUB}/calculations.json').read_text())
21b.check('published equals filed calculations.json', pm == calc['median_decode_ms'], f'{pm} vs {calc["median_decode_ms"]}')
22b.add('published.prefill_ms', round(statistics.median(r['prefill_ms'] for r in pub), 3), 'ms', 'MEASURED',
23 [f'{PUB}/native/sample{i}.stdout' for i in range(1, 6)], 'median over runs of the sum of the 30 prompt step times')
24
25rep = [omega_run(ROOT / f'{REP}/uxl-native-run{i}.txt') for i in range(1, 6)]
26b.check('repeat ids equal published', all(r['ids'] == pub_ids for r in rep))
27rmeds = [round(r['decode_ms_median'], 3) for r in rep]
28b.add('repeat.run_medians', rmeds, 'ms/token', 'MEASURED', [f'{REP}/uxl-native-run{i}.txt' for i in range(1, 6)],
29 'median of 255 decode steps per run')
30rm = b.add('repeat.decode_ms', round(statistics.median(rmeds), 3), 'ms/token', 'MEASURED',
31 [f'{REP}/uxl-native-run{i}.txt' for i in range(1, 6)], 'median of the five run medians')
32b.add('repeat.prefill_ms', round(statistics.median(r['prefill_ms'] for r in rep), 3), 'ms', 'MEASURED',
33 [f'{REP}/uxl-native-run{i}.txt' for i in range(1, 6)], 'median over runs of the 30 prompt step times')
34
35ctl = omega_run(ROOT / f'{REP}/uxl-native-control.txt')
36b.add('repeat.control_first_difference', first_difference(ctl['ids'], pub_ids), 'index', 'MEASURED',
37 f'{REP}/uxl-native-control.txt', 'first index where the altered-weights plan differs from the published ids')
38
39g = json.loads((ROOT / f'{REP}/uxl-graph-fresh.json').read_text())
40b.check('HIP graph ids equal published', g['ids'] == pub_ids)
41hip = b.add('repeat.hip_graph_ms', round(g['decode_ms_median'], 3), 'ms/token', 'MEASURED', f'{REP}/uxl-graph-fresh.json',
42 'decode_ms_median of one HIP graph replay process (255 steps)')
43r = json.loads((ROOT / f'{REP}/uxl-reference-fresh.json').read_text())
44b.add('repeat.pytorch_fp8_ms', round(r['decode_ms_median'], 3), 'ms/token', 'MEASURED', f'{REP}/uxl-reference-fresh.json',
45 'decode_ms_median, PyTorch plus transformers on ROCm, FP8 checkpoint')
46b.add('repeat.pytorch_fp8_first_difference_vs_spark', r['first_divergence'], 'index', 'MEASURED', f'{REP}/uxl-reference-fresh.json',
47 'first_divergence field')
48b.add('repeat.omega_vs_pytorch_first_difference', first_difference(rep[0]['ids'], r['ids']), 'index', 'MEASURED',
49 [f'{REP}/uxl-native-run1.txt', f'{REP}/uxl-reference-fresh.json'], 'first generated index where Omega and PyTorch (same card, session and checkpoint) differ')
50s = json.loads((ROOT / f'{REP}/uxl-stock.json').read_text())
51smeds = [x['decode_ms_median'] for x in s['rows'] if x['label'].startswith('run')]
52b.add('repeat.stock_bf16_ms', round(statistics.median(smeds), 3), 'ms/token', 'MEASURED', f'{REP}/uxl-stock.json',
53 'median of the five timed rows (warmup row left out); BF16, 70 prompt tokens, not like for like')
54b.add('gap.ms', round(rm - hip, 3), 'ms/token', 'DERIVED', [f'{REP}/uxl-native-run1.txt', f'{REP}/uxl-graph-fresh.json'],
55 'repeat.decode_ms minus repeat.hip_graph_ms (same session)')
56b.close()