interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / tools / run_gpu_fp8gemm_chip.sh

48 lines · 3332 bytes Raw Blame History
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_fp8gemm_chip.sh EVIDENCE_DIR [PHYSICS_DIR]
18# OWN-30B chip gate for omega_gpu_fp8gemm_api (prefill FP8 grouped GEMM: each distinct expert streamed once for all its rows).
19# Caller holds the GB10 lock: flock /tmp/aien-gb10.lock tools/run_gpu_fp8gemm_chip.sh EVID
20# 0. host proofs first (never hardware results): --host-only (emulation vs double oracle, permutation, budgets) and
21# --sim (bit-identical to the host emulation in both fragment orders, mutants 1-3 caught)
22# 1. main: gateup (128x1536x2048), down (128x2048x768), qkv (5120x2048), o (2048x4096), 64 tokens: every output
23# bit-identical to the per-row FP8 GEMV, host emulation + oracle on sampled outputs, second call identical,
24# scales-dropped / pointer / row-mix mutants caught on the chip, timing medians (host caches evicted) vs the
25# per-token grouped GEMV path
26# 2. informational, one variable per run: --no-evict, --mt 8 / --mt 2 on gateup, --tokens 128 (M=1024) on gateup
27# Verdict line last: "GPU_FP8GEMM_CHIP: PASS|FAIL". Steps 0 and 1 decide.
28set -u
29EVID="${1:?evidence dir}"; PHYS="${2:-$HOME/workspace/physics-own30b-k}"
30"$(dirname "$0")/require_physics_pin.sh" "$PHYS" || exit 2 # omega#456: refuse a Physics checkout other than physics.lock
31HERE="$(cd "$(dirname "$0")/.." && pwd)"
32mkdir -p "$EVID"; cd "$HERE" || exit 2
33{
34 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)"
35 uname -a; nvidia-smi --query-gpu=name,driver_version --format=csv,noheader 2>/dev/null; free -g | head -2
36} > "$EVID/device.txt"
37make PHYSICS_DIR="$PHYS" -j10 build/gpu_fp8gemm_test > "$EVID/build.log" 2>&1 || { echo "GPU_FP8GEMM_CHIP: FAIL build"; exit 1; }
38T=./build/gpu_fp8gemm_test; fail=0
39$T --host-only 2>&1 | tee "$EVID/host-only.log"; [ "${PIPESTATUS[0]}" = 0 ] || fail=1
40$T --sim 2>&1 | tee "$EVID/sim.log"; [ "${PIPESTATUS[0]}" = 0 ] || fail=1
41$T --reps 15 --out "$EVID/receipt-main.json" 2>&1 | tee "$EVID/main.log"; [ "${PIPESTATUS[0]}" = 0 ] || fail=1
42for v in "--no-evict:noevict" "--shape gateup --mt 8:gateup-mt8" "--shape gateup --mt 2:gateup-mt2" "--shape gateup --tokens 128:gateup-m1024" "--shape down --tokens 128:down-m1024"; do
43 a="${v%%:*}"; n="${v##*:}"
44 $T --reps 9 $a --out "$EVID/receipt-$n.json" 2>&1 | tee "$EVID/$n.log"; echo "$a exit ${PIPESTATUS[0]} (informational)" | tee -a "$EVID/$n.log"
45done
46echo "end $(date -u +%FT%TZ)" >> "$EVID/device.txt"
47(cd "$EVID" && sha256sum *.json *.log *.txt > SHA256SUMS)
48if [ $fail = 0 ]; then echo "GPU_FP8GEMM_CHIP: PASS"; else echo "GPU_FP8GEMM_CHIP: FAIL"; exit 1; fi