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_fp8_v2_chip.sh

54 lines · 3544 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_fp8_v2_chip.sh EVIDENCE_DIR [PHYSICS_DIR]
18# OWN-30B W-L2c chip gate for the FP8 GEMV variant 2 (omega_blackwell_codegen_moe2.c), run as a whole under the GB10 lock:
19# flock /tmp/aien-gb10.lock tools/run_gpu_fp8_v2_chip.sh EVID
20# 0. host proofs (never hardware results): --host-only (v2 budgets, register file, listing) and --sim (v2 bit-identical to v1, mutants)
21# 1. baseline: the fp8 battery on variant 1 (parity, mutants, GB/s per shape) -> receipt-v1.json
22# 2. the same battery on variant 2 (--variant 2): parity, chip mutants, GB/s -> receipt-v2.json
23# 3. decode graph (synthetic 2 layers, real shapes): v1, v2, v1, v2 interleaved, REPS 5, timeline per kind + logits hash.
24# The logits hash must be the same on every run (bit-identical token and logits on the chip).
25# Verdict line last: "GPU_FP8_V2_CHIP: PASS|FAIL". Steps 0, 2 and the hash equality decide; GB/s are recorded.
26set -u
27EVID="${1:?evidence dir}"; PHYS="${2:-$HOME/workspace/physics-own30b-k}"
28"$(dirname "$0")/require_physics_pin.sh" "$PHYS" || exit 2 # omega#456: refuse a Physics checkout other than physics.lock
29HERE="$(cd "$(dirname "$0")/.." && pwd)"
30mkdir -p "$EVID"
31cd "$HERE" || exit 2
32{
33 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)"
34 uname -a; nvidia-smi --query-gpu=name,driver_version --format=csv,noheader 2>/dev/null; free -g | head -2; uptime
35} > "$EVID/device.txt"
36make PHYSICS_DIR="$PHYS" -j10 build/gpu_fp8_api_test build/gpu_decode_graph_test > "$EVID/build.log" 2>&1 || { echo "GPU_FP8_V2_CHIP: FAIL build"; exit 1; }
37T=./build/gpu_fp8_api_test; D=./build/gpu_decode_graph_test
38fail=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 50 --out "$EVID/receipt-v1.json" 2>&1 | tee "$EVID/v1.log"; echo "v1 exit ${PIPESTATUS[0]} (baseline)" | tee -a "$EVID/v1.log"
42$T --reps 50 --variant 2 --out "$EVID/receipt-v2.json" 2>&1 | tee "$EVID/v2.log"; [ "${PIPESTATUS[0]}" = 0 ] || fail=1
43for r in 1 2; do
44 for v in 1 2; do
45 $D --reps 5 --variant $v --out "$EVID/receipt-graph-v$v-r$r.json" 2>&1 | tee "$EVID/graph-v$v-r$r.log"; [ "${PIPESTATUS[0]}" = 0 ] || fail=1
46 done
47done
48hashes=$(grep -ho '"C0_logits_fnv":"[0-9a-f]*"' "$EVID"/receipt-graph-*.json | sort -u | wc -l)
49echo "logits hashes across the 4 graph runs: $hashes distinct (must be 1)" | tee "$EVID/hash.txt"
50[ "$hashes" = 1 ] || fail=1
51grep -h "TIMELINE\|fp8 knobs" "$EVID"/graph-v*.log | tee "$EVID/timelines.txt"
52echo "end $(date -u +%FT%TZ)" >> "$EVID/device.txt"
53(cd "$EVID" && sha256sum *.json *.log *.txt > SHA256SUMS)
54if [ $fail = 0 ]; then echo "GPU_FP8_V2_CHIP: PASS"; else echo "GPU_FP8_V2_CHIP: FAIL"; exit 1; fi