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_l1g_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_l1g_chip.sh EVIDENCE_DIR [what...] (W-L1G, OWN-30B L1 GEMM, 2026-10-14) |
| 18 | # what: qmma (QMMA arithmetic probe + peak, then a confirmation seed), pfgemm (GEMM v2 chip gate, 4 shapes at 3600 tokens), |
| 19 | # qgemm (native FP8 path: quantiser + QMMA GEMM chip gate, 4 shapes at 3600 tokens, then a wait-0 probe on gateup). |
| 20 | # GEMM v2 runs at rt 4 warps 16 aqn 1: rt 8 needs 32768 shared bytes, over the QMD cap of 16384. Default: qmma pfgemm. Kernel tests only, no model load. |
| 21 | # Caller holds the GB10 lock: flock /tmp/aien-gb10.lock tools/run_l1g_chip.sh EVID ... |
| 22 | set -u |
| 23 | EVID="${1:?evidence dir}"; shift; WHAT="${*:-qmma pfgemm}" |
| 24 | PHYS="${PHYS:-$HOME/workspace/physics-own30b-k}"; OUT="${OUT_DIR:-/tmp/wl1g-omega}" |
| 25 | "$(dirname "$0")/require_physics_pin.sh" "$PHYS" || exit 2 # omega#456: refuse a Physics checkout other than physics.lock |
| 26 | HERE="$(cd "$(dirname "$0")/.." && pwd)" |
| 27 | mkdir -p "$EVID"; cd "$HERE" || exit 2 |
| 28 | { |
| 29 | echo "start $(date -u +%FT%TZ) omega=$(git rev-parse HEAD) branch=$(git rev-parse --abbrev-ref HEAD) dirty=$(git status --porcelain --untracked-files=no | wc -l) physics=$PHYS physics_commit=$(git -C "$PHYS" rev-parse HEAD) what=$WHAT" |
| 30 | uname -a; nvidia-smi --query-gpu=name,driver_version --format=csv,noheader 2>/dev/null; free -g | head -2 |
| 31 | } > "$EVID/device.txt" |
| 32 | make OUT_DIR="$OUT" PHYSICS_DIR="$PHYS" -j10 "$OUT/gpu_qmma_probe_test" "$OUT/gpu_pfgemm_test" "$OUT/gpu_qgemm_test" > "$EVID/build.log" 2>&1 || { echo "L1G_CHIP: FAIL build"; exit 1; } |
| 33 | fail=0 |
| 34 | run() { local name="$1"; shift; "$@" > "$EVID/$name.log" 2>&1; local rc=$?; echo "$name exit $rc: $*" >> "$EVID/exits.txt"; [ $rc = 0 ] || fail=1; tail -1 "$EVID/$name.log" | sed "s/^/$name: /"; } |
| 35 | for w in $WHAT; do case $w in |
| 36 | qmma) run qmma-probe "$OUT/gpu_qmma_probe_test" --save "$EVID/qmma-words.bin" |
| 37 | QMMA_PROBE_SEED=0x1234567 run qmma-probe-seed2 "$OUT/gpu_qmma_probe_test" --no-peak ;; |
| 38 | pfgemm) run pfgemm-chip "$OUT/gpu_pfgemm_test" --shape-knob 4 16 1 --chip --tokens 3600 --reps 7 ;; |
| 39 | qgemm) run qgemm-chip "$OUT/gpu_qgemm_test" --chip --tokens 3600 --reps 7 |
| 40 | run qgemm-cached "$OUT/gpu_qgemm_test" --chip --cached --tokens 3600 --reps 7 |
| 41 | for s in gateup down; do run qgemm-cached-wait0-$s "$OUT/gpu_qgemm_test" --chip --cached --shape $s --wait 0 --tokens 3600 --reps 7; done ;; |
| 42 | esac; done |
| 43 | echo "end $(date -u +%FT%TZ)" >> "$EVID/device.txt" |
| 44 | (cd "$EVID" && sha256sum * 2>/dev/null | grep -v SHA256SUMS > SHA256SUMS) |
| 45 | if [ $fail = 0 ]; then echo "L1G_CHIP: PASS"; else echo "L1G_CHIP: FAIL"; exit 1; fi |