interplane.Get Omega
Read in your language

omega-bridge

Omega-first language interoperability: checked conversion backends and native language bindings

Brought by drakestapleton

branch main Branches Tags History

omega-bridge / docs / REPRODUCE.md

112 lines · 3797 bytes Raw Blame History Rendered
1# Reproduce the verified host results
2
3All commands are run from a checkout on Linux AArch64. No step requires the GPU
4unless marked **window**. The three branches are:
5
6| Repo | Branch |
7|---|---|
8| `aien-dev/omega-mv` | `feat/max-interop-contracts` |
9| `aien-dev/CUDApp` | `feat/max-artifact-export` |
10| `aien-dev/omega-bridge` | `feat/gpu-interop` |
11
12Paths below assume sibling checkouts: `omega/`, `cudapp/`, `bridge/`.
13
14## 0. Tools
15
16- `gcc`, `make`, `sha256sum`, `file`, `python3` (stdlib only for the oracle and
17 receipt tests).
18- Omega seed compiler, checked by fingerprint
19 `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`. Provide
20 it as `OMEGA_SEED=/path/to/omc`; the bridge worktree also uses `build/omc`.
21- Optional independent readers: `nvdisasm`, `cuobjdump` (CUDA 13).
22- MAX tests: a venv with `modular==26.7.0` (`MAXPY=/path/to/venv/bin/python`).
23
24## 1. Contracts and oracle (no GPU)
25
26```sh
27cd omega
28sh tools/max-interop/build.sh
29python3 tests/max-interop/test_contracts.py
30# 26/26; contract ids 647116fc… and 003696e4…
31```
32
33Expected contract ids:
34`matmul-bf16-v1` = `647116fc1ba1e1394982fc8ba181ce565293f160a6b56afc0f02b2128a675704`,
35`gqa-causal-v1` = `003696e422bba7274877ba9e01a61076ea0f862f32760cbaa06c60f85a115359`.
36
37## 2. Native artifact + cubin (no GPU)
38
39```sh
40cd cudapp
41make -j8 test-native-artifact
42./tools/artifact_smoke.sh evidence/MAX-INTEROP/68
43```
44
45This builds `build/artifact-export`, exports the frozen matmul and attention
46artifacts, and validates them with `nvdisasm`/`cuobjdump`. To recreate the
47committed evidence:
48
49```sh
50./build/artifact-export matmul --m 16 --k 16 --n 8 \
51 --contract-id 647116fc1ba1e1394982fc8ba181ce565293f160a6b56afc0f02b2128a675704 \
52 --out evidence/MAX-INTEROP/68/matmul-16x16x8 --commit <40-hex-source-commit>
53./build/artifact-export attention --q-heads 8 --kv-heads 1 \
54 --contract-id 003696e422bba7274877ba9e01a61076ea0f862f32760cbaa06c60f85a115359 \
55 --out evidence/MAX-INTEROP/68/attention-hd128-gqa8 --commit <40-hex-source-commit>
56```
57
58## 3. Envelope + C2 receipt (no GPU)
59
60```sh
61cd omega
62sh tests/max-interop/build_receipt.sh
63python3 tests/max-interop/test_envelope.py \
64 --artifact ../../cudapp/evidence/MAX-INTEROP/68/matmul-16x16x8 \
65 --fixture tests/max-interop/fixtures/matmul-v1.json
66# 26/26; envelope 4b17c821…, receipt f13b1bff…
67```
68
69The receipt uses the existing TEST key through `src/checker2/c2_receipt.c`; it
70attests provenance only. `execution=NOT_RUN` is deliberate.
71
72## 4. Bridge adapter (no GPU)
73
74```sh
75cd bridge
76sh tools/build-gpu-adapter.sh
77python3 tests/gpu/test_gpu_adapter.py \
78 --artifact ../../cudapp/evidence/MAX-INTEROP/68/matmul-16x16x8
79# 49/49, ACCEPT/REFUSE coverage
80```
81
82## 5. Conformance harness (CPU smoke)
83
84```sh
85cd bridge
86MAXPY=/path/to/venv/bin/python sh conformance/run.sh
87# CONFORMANCE HARNESS PASS; device runs NOT_RUN
88```
89
90## 6. Authorized GPU window (not executed here)
91
92The coordinator holds `~/.local/state/aien-coordinator/CHIP-RESERVED`, so
93`spark-window open` refuses. When a window is granted:
94
95```sh
96# 1. Load/run the exported cubin through the vendor loader.
97cd cudapp
98spark-window open maxinterop-cubin --ledger L679 --gb10 shared --quiet none --lease 10
99spark-window run ./build/cubin_probe evidence/MAX-INTEROP/68/matmul-16x16x8.cubin \
100 omega_matmul_bf16 16 16 8
101spark-window close
102
103# 2. Stage A: Omega native, then MAX, in separate processes.
104cd ../bridge
105spark-window open maxinterop-stageA --ledger L679 --gb10 shared --quiet none --lease 10
106SPARK_WINDOW=$SPARK_WINDOW sh conformance/run.sh --device
107spark-window close
108```
109
110A GPU run must record its `SPARK_WINDOW` id; `verify.py` refuses a GPU result
111without one. Do not use `--quiet none` for a reported speed; use the quiet lock
112for measurements and keep all runs, including failures.