interplane.Get Omega
Read in your language

aien-train

AIEN training programme: language-model history, GB10 constraints and the route to training on the project engine. Plans and runnable checks are distinguished.

Brought by drakestapleton

branch main Branches Tags History

aien-train / tests / omegalora / run.sh

41 lines · 1955 bytes Raw Blame History
1#!/bin/sh
2# SPDX-License-Identifier: AGPL-3.0-only
3# omegalora host glue (POSIX sh): compile native/omegalora/lora.om with the pinned seeded omc,
4# run the real build and the three mutants, and record every status. All math, training and
5# verdicts are in the .om unit; this script only compiles, runs and compares exit codes.
6# Usage: sh tests/omegalora/run.sh Env: OMC (pinned omc), OUT (default evidence/OMEGALORA/run).
7# Host CPU only (AArch64 Linux, the omc target). No GPU, network or service is touched.
8set -u
9ROOT=$(cd "$(dirname "$0")/../.." && pwd)
10OUT=${OUT:-$ROOT/evidence/OMEGALORA/run}
11OMC=${OMC:-$ROOT/../omega-mv/seed/out/omc}
12OMC_SHA=2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f
13BUILD=$(mktemp -d "${TMPDIR:-/tmp}/omegalora.XXXXXX")
14mkdir -p "$OUT"
15SUM="$OUT/summary.txt"
16: > "$SUM"
17note() { echo "$*" | tee -a "$SUM"; }
18fail() { note "OMEGALORA_FAIL $*"; exit 1; }
19note "source_commit=$(git -C "$ROOT" rev-parse HEAD)"
20note "host=$(uname -srm)"
21set -- $(sha256sum "$OMC")
22[ "$1" = "$OMC_SHA" ] || fail "compiler hash $1"
23note "compiler_sha256=$1"
24"$OMC" < "$ROOT/native/omegalora/lora.om" > "$BUILD/lora" 2> "$OUT/compile.stderr" || fail compile
25chmod +x "$BUILD/lora"
26set -- $(sha256sum "$ROOT/native/omegalora/lora.om"); note "source_sha256=$1"
27set -- $(sha256sum "$BUILD/lora"); note "binary_sha256=$1"
28# case MUTANT EXPECTED_EXIT: 0 real build, 1 silu grad, 2 rmsnorm grad, 3 adam sign
29bad=0
30for c in 0:0 1:10 2:10 3:11; do
31 mu=${c%%:*}; want=${c##*:}
32 printf '%s' "$mu" | "$BUILD/lora" > "$OUT/mutant$mu.stdout" 2> "$OUT/mutant$mu.stderr"
33 rc=$?
34 echo "$rc" > "$OUT/mutant$mu.rc"
35 if [ "$rc" = "$want" ]; then note "mutant$mu exit=$rc expected=$want PASS"
36 else note "mutant$mu exit=$rc expected=$want FAIL"; bad=1; fi
37done
38(cd "$OUT" && sha256sum mutant*.rc mutant*.stdout mutant*.stderr compile.stderr) > "$OUT/raw.sha256"
39rm -rf "$BUILD"
40[ $bad = 0 ] || fail "exit code mismatch"
41note OMEGALORA_PASS