omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / tools / run_gpu_decode_graph_chip.sh
| 1 | #!/bin/bash |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | # Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | # run_gpu_decode_graph_chip.sh EVIDENCE_DIR [main|red|cached] [PHYSICS_DIR] |
| 18 | # cached: main with --cached-weights (FP8 tensors in GPU-cached memory); verdict "GPU_DECODE_GRAPH_CHIP_CACHED: PASS|FAIL" |
| 19 | # OWN-30B W-L2a chip gate for omega_gpu_decode_graph (one Qwen3-30B-A3B decode token as one command list). |
| 20 | # Caller holds the GB10 lock: flock /tmp/aien-gb10.lock tools/run_gpu_decode_graph_chip.sh EVID |
| 21 | # 0. host proofs first (never hardware results): --host-only |
| 22 | # 1. main: A (today's path, host glue) vs C (one list) vs B (one launch per submission), synthetic 2-layer step on |
| 23 | # random weights, real vocab 151936; argmax identical, logits within tolerance, B == C bit for bit, negative |
| 24 | # controls (SWIGLU / COMBINE mutants) caught; per-token medians over REPS (20). |
| 25 | # red: the same with the wrong-wiring mutant in C (must FAIL: red-before-green receipt). |
| 26 | # Verdict line last: "GPU_DECODE_GRAPH_CHIP: PASS|FAIL" (red: "GPU_DECODE_GRAPH_CHIP_RED: FAILED_AS_EXPECTED|UNEXPECTED_PASS"). |
| 27 | set -u |
| 28 | EVID="${1:?evidence dir}"; MODE="${2:-main}"; PHYS="${3:-$HOME/workspace/physics-own30b-k}" |
| 29 | "$(dirname "$0")/require_physics_pin.sh" "$PHYS" || exit 2 # omega#456: refuse a Physics checkout other than physics.lock |
| 30 | HERE="$(cd "$(dirname "$0")/.." && pwd)" |
| 31 | mkdir -p "$EVID" |
| 32 | cd "$HERE" || exit 2 |
| 33 | { |
| 34 | echo "start $(date -u +%FT%TZ) mode=$MODE omega=$(git rev-parse HEAD) branch=$(git rev-parse --abbrev-ref HEAD) dirty=$(git status --porcelain | wc -l) physics=$PHYS physics_commit=$(git -C "$PHYS" rev-parse HEAD)" |
| 35 | uname -a; nvidia-smi --query-gpu=name,driver_version --format=csv,noheader 2>/dev/null; free -g | head -2 |
| 36 | } > "$EVID/device.txt" |
| 37 | git diff HEAD > "$EVID/worktree.diff" |
| 38 | make PHYSICS_DIR="$PHYS" -j10 build/gpu_decode_graph_test > "$EVID/build.log" 2>&1 || { echo "GPU_DECODE_GRAPH_CHIP: FAIL build"; exit 1; } |
| 39 | T=./build/gpu_decode_graph_test |
| 40 | sha256sum "$T" build/libomega_gpu.a > "$EVID/binaries.sha256" |
| 41 | fail=0 |
| 42 | $T --host-only 2>&1 | tee "$EVID/host-only.log"; [ "${PIPESTATUS[0]}" = 0 ] || fail=1 |
| 43 | if [ "$MODE" = cached ]; then |
| 44 | $T --cached-weights --reps "${REPS:-20}" --out "$EVID/receipt-cached.json" 2>&1 | tee "$EVID/cached.log"; rc=${PIPESTATUS[0]} |
| 45 | echo "end $(date -u +%FT%TZ) cached_exit=$rc" >> "$EVID/device.txt" |
| 46 | (cd "$EVID" && sha256sum *.json *.log *.txt *.diff *.sha256 > SHA256SUMS) |
| 47 | if [ "$rc" = 0 ] && [ $fail = 0 ]; then echo "GPU_DECODE_GRAPH_CHIP_CACHED: PASS"; exit 0; else echo "GPU_DECODE_GRAPH_CHIP_CACHED: FAIL"; exit 1; fi |
| 48 | fi |
| 49 | if [ "$MODE" = red ]; then |
| 50 | $T --red --reps "${REPS:-3}" --out "$EVID/receipt-red.json" 2>&1 | tee "$EVID/red.log"; rc=${PIPESTATUS[0]} |
| 51 | echo "end $(date -u +%FT%TZ) red_exit=$rc" >> "$EVID/device.txt" |
| 52 | (cd "$EVID" && sha256sum *.json *.log *.txt *.diff *.sha256 > SHA256SUMS) |
| 53 | if [ "$rc" != 0 ]; then echo "GPU_DECODE_GRAPH_CHIP_RED: FAILED_AS_EXPECTED"; else echo "GPU_DECODE_GRAPH_CHIP_RED: UNEXPECTED_PASS"; exit 1; fi |
| 54 | exit 0 |
| 55 | fi |
| 56 | $T --reps "${REPS:-20}" --out "$EVID/receipt-main.json" 2>&1 | tee "$EVID/main.log"; [ "${PIPESTATUS[0]}" = 0 ] || fail=1 |
| 57 | echo "end $(date -u +%FT%TZ)" >> "$EVID/device.txt" |
| 58 | (cd "$EVID" && sha256sum *.json *.log *.txt *.diff *.sha256 > SHA256SUMS) |
| 59 | if [ $fail = 0 ]; then echo "GPU_DECODE_GRAPH_CHIP: PASS"; else echo "GPU_DECODE_GRAPH_CHIP: FAIL"; exit 1; fi |