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_tcgemm_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_tcgemm_chip.sh EVIDENCE_DIR [PHYSICS_DIR] |
| 18 | # OWN-30B T3 cut 1 chip gate: tensor-core FP8 grouped GEMM (omega_gpu_tcgemm_api). Per point: 5 independent process runs, |
| 19 | # each = upload, bit-identity vs the C emulation on sampled rows, second call identical, mutants 1-4 (run 1 only), medians of 9. |
| 20 | # Points: gate|up and down at 128 tokens (the FFMA baseline's M=1024, evidence/OWN30B-T3-BASELINE-*) and at 3600 tokens, |
| 21 | # dense qkv and o at 3600 tokens. Kernel only, no model load. Caller holds the lock: flock /tmp/aien-gb10.lock tools/run_gpu_tcgemm_chip.sh EVID |
| 22 | set -u |
| 23 | EVID="${1:?evidence dir}"; PHYS="${2:-$HOME/workspace/physics-own30b-k}"; OUT="${OUT_DIR:-/tmp/t3-omega}" |
| 24 | "$(dirname "$0")/require_physics_pin.sh" "$PHYS" || exit 2 # omega#456: refuse a Physics checkout other than physics.lock |
| 25 | HERE="$(cd "$(dirname "$0")/.." && pwd)" |
| 26 | mkdir -p "$EVID"; cd "$HERE" || exit 2 |
| 27 | { |
| 28 | echo "start $(date -u +%FT%TZ) 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)" |
| 29 | uname -a; nvidia-smi --query-gpu=name,driver_version --format=csv,noheader 2>/dev/null; free -g | head -2 |
| 30 | } > "$EVID/device.txt" |
| 31 | make OUT_DIR="$OUT" PHYSICS_DIR="$PHYS" -j10 "$OUT/gpu_tcgemm_test" > "$EVID/build.log" 2>&1 || { echo "TCGEMM_CHIP: FAIL build"; exit 1; } |
| 32 | T="$OUT/gpu_tcgemm_test"; fail=0 |
| 33 | for pt in "gateup 128" "down 128" "gateup 3600" "down 3600" "qkv 3600" "o 3600"; do |
| 34 | set -- $pt; shape=$1; tok=$2 |
| 35 | for r in 1 2 3 4 5; do |
| 36 | extra="--no-mutants"; [ $r = 1 ] && extra="" |
| 37 | $T --chip --shape $shape --tokens $tok --reps 9 --check-rows 256 $extra --out "$EVID/receipt-$shape-$tok-r$r.json" > "$EVID/$shape-$tok-r$r.log" 2>&1 |
| 38 | rc=$?; echo "$shape $tok r$r exit $rc" >> "$EVID/exits.txt"; [ $rc = 0 ] || fail=1 |
| 39 | grep -h "TCGEMM \|bit-identity\|mutant\|FAIL" "$EVID/$shape-$tok-r$r.log" | sed "s/^/$shape $tok r$r: /" |
| 40 | done |
| 41 | done |
| 42 | echo "end $(date -u +%FT%TZ)" >> "$EVID/device.txt" |
| 43 | (cd "$EVID" && sha256sum *.json *.log *.txt > SHA256SUMS) |
| 44 | if [ $fail = 0 ]; then echo "TCGEMM_CHIP: PASS"; else echo "TCGEMM_CHIP: FAIL"; exit 1; fi |