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

54 lines · 3326 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_l2d_barrier_chip.sh EVIDENCE_DIR [PHYSICS_DIR] (OWN-30B W-L2d, 2026-10-14; run under flock /tmp/aien-gb10.lock)
18# One variable: the barrier between the launches of one command list. Kernel-only (no model load).
19# 1. launch-cost repro (33 MB FP8 GEMV split 1..16 ways): wfi, wfi_only, wfi_data, flush_data, none, wfi (drift control)
20# 2. decode graph (synthetic 2-layer token): barrier 0 (baseline), 2, 3, 4, 0 again; each run checks B (per-launch submits)
21# == C (one list) bit for bit, the mutants, and prints the per-kind TIMELINE + logits hash
22# 3. negative control: decode graph with barrier 1 (none) MUST FAIL
23# Verdict line last: "GPU_L2D_BARRIER_CHIP: PASS|FAIL".
24set -u
25EVID="${1:?evidence dir}"; PHYS="${2:-$HOME/workspace/physics-own30b-k}"
26"$(dirname "$0")/require_physics_pin.sh" "$PHYS" || exit 2 # omega#456: refuse a Physics checkout other than physics.lock
27HERE="$(cd "$(dirname "$0")/.." && pwd)"
28mkdir -p "$EVID"
29cd "$HERE" || exit 2
30{
31 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)"
32 uname -a; nvidia-smi --query-gpu=name,driver_version --format=csv,noheader 2>/dev/null; free -g | head -2; uptime
33} > "$EVID/device.txt"
34make PHYSICS_DIR="$PHYS" -j10 build/gpu_decode_graph_test build/gpu_launch_cost_test > "$EVID/build.log" 2>&1 || { echo "GPU_L2D_BARRIER_CHIP: FAIL build"; exit 1; }
35D=./build/gpu_decode_graph_test; L=./build/gpu_launch_cost_test
36sha256sum "$D" "$L" build/libomega_gpu.a > "$EVID/binaries.sha256"
37fail=0
38if [ "${SKIP_COST:-0}" != 1 ]; then
39 $L --reps "${REPS_COST:-20}" --out "$EVID/receipt-cost.json" > "$EVID/cost.log" 2>&1 || fail=1
40 grep -E "^COST|PASS|FAIL" "$EVID/cost.log" | tail -40
41fi
42i=0
43for b in 0 2 3 4 0; do
44 i=$((i + 1))
45 $D --barrier "$b" --reps "${REPS:-10}" --out "$EVID/receipt-graph-$i-b$b.json" > "$EVID/graph-$i-b$b.log" 2>&1 || fail=1
46 echo "graph $i barrier $b: $(grep -E '^fp8 knobs|TIMELINE|PER TOKEN|^chip:' "$EVID/graph-$i-b$b.log" | tr '\n' ' ')"
47 grep -o '"C0_logits_fnv":"[0-9a-f]*"' "$EVID/receipt-graph-$i-b$b.json"
48done
49$D --barrier 1 --reps 3 --out "$EVID/receipt-graph-red-b1.json" > "$EVID/graph-red-b1.log" 2>&1; rc=$?
50echo "negative control barrier none: exit $rc ($(tail -1 "$EVID/graph-red-b1.log"))"
51[ "$rc" != 0 ] || { echo "negative control UNEXPECTED_PASS"; fail=1; }
52echo "end $(date -u +%FT%TZ)" >> "$EVID/device.txt"
53(cd "$EVID" && sha256sum ./* 2>/dev/null | grep -v SHA256SUMS > SHA256SUMS)
54if [ $fail = 0 ]; then echo "GPU_L2D_BARRIER_CHIP: PASS"; else echo "GPU_L2D_BARRIER_CHIP: FAIL"; exit 1; fi