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 / FLASH-NEXT-CONTROL-FIX-20261118 / summarize.py
| 1 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | # summarize.py: counts from exercise.py output. Fails (exit 1) on any inconsistency between the historical |
| 3 | # record, the historical re-run and the strict decoder. usage: python3 -I summarize.py RESULTS_JSONL |
| 4 | import collections, json, sys |
| 5 | |
| 6 | recs = [json.loads(l) for l in open(sys.argv[1])] |
| 7 | bad = [] |
| 8 | c = collections.Counter() |
| 9 | from_end = collections.Counter() |
| 10 | for r in recs: |
| 11 | role, fc, hr, s = r['role'], r['fullcover'], r['hist_rerun'], r['strict'] |
| 12 | f, cl = s['flip'], s['clean'] |
| 13 | c[role] += 1 |
| 14 | if not (fc['coded'] == hr['coded'] == s['coded'] and fc['roundtrip'] == hr['roundtrip'] == 1 |
| 15 | and fc['flip_detected'] == hr['flip_detected'] == int(f['hist_detected'])): |
| 16 | bad.append(('historical verdict not reproduced', r['name'])) |
| 17 | if cl != {'bytes_equal': '1', 'strict_ok': '1'}: |
| 18 | bad.append(('clean stream failed strict check', r['name'])) |
| 19 | if f['strict_detected'] != '1': |
| 20 | bad.append(('strict check missed the flip', r['name'])) |
| 21 | c[(role, f['class'])] += 1 |
| 22 | for k in ('init_bad', 'starved', 'leftover', 'term_bad'): |
| 23 | c[(role, k)] += int(f[k]) |
| 24 | if role == 'missed': |
| 25 | from_end[int(f['from_row_end'])] += 1 |
| 26 | for k in sorted(c, key=str): |
| 27 | print(k if isinstance(k, str) else ' '.join(k), c[k]) |
| 28 | print('missed from_row_end', dict(sorted(from_end.items()))) |
| 29 | print('inconsistencies', len(bad)) |
| 30 | for b in bad: |
| 31 | print('BAD', *b) |
| 32 | sys.exit(1 if bad else 0) |