omega-bridge
Omega-first language interoperability: checked conversion backends and native language bindings
Brought by drakestapleton
omega-bridge / conformance / run.sh
| 1 | #!/bin/sh |
| 2 | # Host harness smoke. A GPU run is an explicit second mode and needs SPARK_WINDOW. |
| 3 | set -eu |
| 4 | cd "$(dirname "$0")" |
| 5 | PY=${PYTHON:-python3} |
| 6 | MAXPY=${MAXPY:-$HOME/workspace/maxinterop/venv/bin/python} |
| 7 | $PY test_max_runner_metadata.py |
| 8 | mkdir -p build |
| 9 | $PY gen_fixtures.py --out build/fixtures |
| 10 | sh build.sh |
| 11 | fail=0 |
| 12 | # MAX 26.7.0 Graph() opens a visible GPU even for an all-CPU graph, so the CPU runs |
| 13 | # hide it; max_runner.py --device cpu refuses while an accelerator is visible. |
| 14 | for f in matmul-v1 gqa-causal-v1; do |
| 15 | CUDA_VISIBLE_DEVICES= $MAXPY max_runner.py --fixture build/fixtures/$f.json --device cpu --out build/max-$f || fail=1 |
| 16 | $PY verify.py --fixture build/fixtures/$f.json --result build/max-$f --expect-device cpu || fail=1 |
| 17 | done |
| 18 | ./build/omega_runner matmul --m 4 --k 5 --n 3 --seed 680 --out build/omega-matmul-v1 || fail=1 |
| 19 | $PY verify.py --fixture build/fixtures/matmul-v1.json --result build/omega-matmul-v1 --expect-device host-wiring || fail=1 |
| 20 | if [ "${1:-}" = "--device" ]; then |
| 21 | ./build/omega_runner matmul --m 4 --k 5 --n 3 --seed 680 --out build/omega-gpu-matmul --device || fail=1 |
| 22 | $PY verify.py --fixture build/fixtures/matmul-v1.json --result build/omega-gpu-matmul --expect-device gpu || fail=1 |
| 23 | $MAXPY max_runner.py --fixture build/fixtures/matmul-v1.json --device gpu --out build/max-gpu-matmul || fail=1 |
| 24 | $PY verify.py --fixture build/fixtures/matmul-v1.json --result build/max-gpu-matmul --expect-device gpu || fail=1 |
| 25 | ./build/omega_runner attention --base 1 --rows 2 --hq 4 --hkv 2 --hd 128 --seed 2810054072 --out build/omega-gpu-attn --device || fail=1 |
| 26 | $PY verify.py --fixture build/fixtures/gqa-causal-v1.json --result build/omega-gpu-attn --expect-device gpu || fail=1 |
| 27 | $MAXPY max_runner.py --fixture build/fixtures/gqa-causal-v1.json --device gpu --out build/max-gpu-attn || fail=1 |
| 28 | $PY verify.py --fixture build/fixtures/gqa-causal-v1.json --result build/max-gpu-attn --expect-device gpu || fail=1 |
| 29 | else |
| 30 | echo "DEVICE RUNS: NOT_RUN (pass --device inside an authorized spark-window)" |
| 31 | fi |
| 32 | [ $fail -eq 0 ] && echo "CONFORMANCE HARNESS PASS" |
| 33 | exit $fail |