aien-sovereign-core-mv
AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.
Brought by drakestapleton
aien-sovereign-core-mv / docs / inference / evidence / adr0004-step3-20261015 / step3-runs.sh
| 1 | #!/bin/bash |
| 2 | # ADR 0004 migration step 3: G30-tokens and G30-speed with the 30B adapter present (the old loop still runs). |
| 3 | # check-full: own30b_check chip, the same arguments as own30b-idle-speed-20261015/own30b-idle-gates.sh |
| 4 | # check-full plus --force-memory (the idle exp445 server on :18091 keeps ~36 GB resident, |
| 5 | # so MemAvailable is below the tool's 70 GB guard; the guard only refuses, it changes nothing). |
| 6 | # door: door-window.sh (G30-door), its own server on PORT. |
| 7 | # One quietlock hold (owner STEP3, 20 min max) per run, released between runs. check-full also runs |
| 8 | # under /tmp/aien-gb10.lock; the door server takes that lock itself around each generation. |
| 9 | # EV=<evidence dir> SC=<worktree at main> [RUN=<n>] step3-runs.sh (RUN=n names the outputs check-full-n, door-n); SKIP_DOOR=1 runs check-full only |
| 10 | set -u |
| 11 | SC=${SC:?worktree} |
| 12 | EV=${EV:?evidence dir} |
| 13 | B=$SC/target/release |
| 14 | CK=$HOME/models/qwen3-30b-a3b-instruct-2507-fp8 |
| 15 | G=$SC/docs/inference/evidence/own30b-f-20261013T1745Z/golden.json |
| 16 | HERE=$(cd "$(dirname "$0")" && pwd) |
| 17 | mkdir -p "$EV" |
| 18 | ground() { # name |
| 19 | { |
| 20 | echo "queued $(date -u +%FT%TZ) sc $(git -C "$SC" rev-parse HEAD) omega $(cat "$SC/omega.lock")" |
| 21 | echo "tracked changes outside this folder: $(git -C "$SC" status --porcelain | grep -v '^?? docs/inference/evidence/adr0004-step3' | grep -cv '^?? target')" |
| 22 | echo "libomega_gpu.a sha256 $(sha256sum "$B"/build/aien-omega-gpu-*/out/omega-build/libomega_gpu.a | cut -d' ' -f1)" |
| 23 | echo "driver $(nvidia-smi --query-gpu=driver_version --format=csv,noheader) kernel $(uname -r)" |
| 24 | uptime; grep MemAvailable /proc/meminfo |
| 25 | nvidia-smi --query-compute-apps=pid,process_name,used_memory --format=csv |
| 26 | nvidia-smi --query-gpu=utilization.gpu,temperature.gpu,power.draw,pstate --format=csv |
| 27 | echo "listeners: $(ss -ltn | awk 'NR>1{print $4}' | grep -E ':180[0-9][0-9]$' | sort | tr '\n' ' ')" |
| 28 | echo ":18091 log lines $(wc -l < "$HOME/workspace/exp445-runlogs/own30b-18091-f881710a.log" 2>/dev/null)" |
| 29 | } > "$EV/$1.start" |
| 30 | } |
| 31 | finish() { # name rc |
| 32 | echo "$2" > "$EV/$1.rc" |
| 33 | { |
| 34 | echo "ended $(date -u +%FT%TZ)"; uptime; grep MemAvailable /proc/meminfo |
| 35 | echo ":18091 log lines $(wc -l < "$HOME/workspace/exp445-runlogs/own30b-18091-f881710a.log" 2>/dev/null)" |
| 36 | } > "$EV/$1.end" |
| 37 | echo "$1 rc=$2" |
| 38 | } |
| 39 | R=${RUN:+-$RUN} |
| 40 | TOK="--prompts 1,2,3,4 --new 16 --layers 0,23,47 --weights fp8 --attn fused --router device --lm-head gemv --prefill auto" |
| 41 | |
| 42 | ground check-full$R |
| 43 | echo "binary $B/own30b_check sha256 $(sha256sum "$B/own30b_check" | cut -d' ' -f1)" >> "$EV/check-full$R.start" |
| 44 | echo "cmd quietlock hold --owner STEP3 --minutes 20 -- flock /tmp/aien-gb10.lock env AIEN_OMEGA_SPIN_US=2000 $B/own30b_check chip $CK $G $EV/check-full$R $TOK --force-memory" >> "$EV/check-full$R.start" |
| 45 | # shellcheck disable=SC2086 |
| 46 | quietlock hold --owner STEP3 --minutes 20 --reason "ADR 0004 step 3 own30b_check chip (adapter present)" -- \ |
| 47 | flock /tmp/aien-gb10.lock sh -c 'echo "lock acquired $(date -u +%FT%TZ)" >> "$0.start"; shift; exec "$@"' "$EV/check-full$R" x \ |
| 48 | env AIEN_OMEGA_SPIN_US=2000 "$B/own30b_check" chip "$CK" "$G" "$EV/check-full$R" $TOK --force-memory \ |
| 49 | > "$EV/check-full$R.raw" 2> "$EV/check-full$R.err" |
| 50 | finish check-full$R $? |
| 51 | |
| 52 | if [ -n "${SKIP_DOOR:-}" ]; then echo "all done $(date -u +%FT%TZ) (door skipped)"; exit 0; fi |
| 53 | ground door$R |
| 54 | echo "binary $B/aien-serve-http sha256 $(sha256sum "$B/aien-serve-http" | cut -d' ' -f1)" >> "$EV/door$R.start" |
| 55 | quietlock hold --owner STEP3 --minutes 20 --reason "ADR 0004 step 3 door seeded sampling" -- \ |
| 56 | "$HERE/../adr0004-step0-baseline-20261015/door-window.sh" "$B/aien-serve-http" "$EV/door$R" 18103 > "$EV/door$R.raw" 2> "$EV/door$R.err" |
| 57 | finish door$R $? |
| 58 | echo "all done $(date -u +%FT%TZ)" |