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_fp8_slots_chip.sh
| 1 | #!/bin/bash |
| 2 | # run_gpu_fp8_slots_chip.sh EVIDENCE_DIR [PHYSICS_DIR] |
| 3 | # Expert Ribbon P1 chip gate (aienix#4 / omega#533): versioned replaceable FP8 expert slots on the GB10. |
| 4 | # host tests/gpu_fp8_slots_test.c --host-only (state machine, threaded race, mutant) |
| 5 | # chip r1-3 --chip: parity vs a resident tensor after every reload (gate|up 1536x2048 and down 2048x768), refusals, |
| 6 | # reader fence through a recorded command list, memory accounting. Must PASS (exit 0) 3/3. |
| 7 | # control --chip --mutant: the pool ignores pins; the recorded list must read replaced weights and the parity |
| 8 | # check must catch it (exit 1, "CAUGHT"). A control that is NOT caught fails the gate. |
| 9 | # Caller holds the GB10 lock: flock /tmp/aien-gb10.lock tools/run_gpu_fp8_slots_chip.sh EVID |
| 10 | # Verdict line last: "GPU_FP8_SLOTS_CHIP: PASS|FAIL". |
| 11 | set -u |
| 12 | EVID="${1:?evidence dir}"; PHYS="${2:-$HOME/workspace/physics-own30b-k}" |
| 13 | HERE="$(cd "$(dirname "$0")/.." && pwd)" |
| 14 | mkdir -p "$EVID" |
| 15 | cd "$HERE" || exit 2 |
| 16 | { |
| 17 | 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) physics_lock=$(head -1 physics.lock)" |
| 18 | uname -a; nvidia-smi --query-gpu=name,driver_version --format=csv,noheader 2>/dev/null; free -g | head -2 |
| 19 | } > "$EVID/device.txt" |
| 20 | make PHYSICS_DIR="$PHYS" -j10 build/gpu_fp8_slots_test > "$EVID/build.log" 2>&1 || { echo "GPU_FP8_SLOTS_CHIP: FAIL build"; exit 1; } |
| 21 | # A stale nvrm.o compiled from another physics checkout survives a PHYSICS_DIR change (make sees it up to |
| 22 | # date) and changes the allocator under the test: refuse the run unless nvrm.o came from $PHYS. |
| 23 | NVRM_D=$(find build -name nvrm.d | head -1) |
| 24 | if [ -z "$NVRM_D" ] || ! grep -q "$(cd "$PHYS" && pwd)/nvrm/nvrm.c" "$NVRM_D"; then |
| 25 | echo "GPU_FP8_SLOTS_CHIP: FAIL build (nvrm.o not built from $PHYS; rm -rf build and rerun)"; exit 1 |
| 26 | fi |
| 27 | T=./build/gpu_fp8_slots_test |
| 28 | fail=0 |
| 29 | $T --host-only > "$EVID/host.log" 2>&1; e=$?; echo "# exit $e" >> "$EVID/host.log"; [ "$e" = 0 ] || fail=1 |
| 30 | echo "host $(tail -2 "$EVID/host.log" | head -1) exit=$e" | tee "$EVID/summary.txt" |
| 31 | for r in 1 2 3; do |
| 32 | f="$EVID/chip-r$r.log" |
| 33 | $T --chip --rounds 64 > "$f" 2>&1; e=$?; echo "# exit $e" >> "$f" |
| 34 | [ "$e" = 0 ] || fail=1 |
| 35 | echo "chip r$r $(grep -h '^GPU_FP8_SLOTS' "$f" | tail -1) exit=$e" | tee -a "$EVID/summary.txt" |
| 36 | done |
| 37 | f="$EVID/control-mutant.log" |
| 38 | $T --chip --mutant > "$f" 2>&1; e=$?; echo "# exit $e" >> "$f" |
| 39 | grep -q 'NEGATIVE_CONTROL: CAUGHT' "$f" && [ "$e" = 1 ] || fail=1 |
| 40 | echo "control $(grep -h 'NEGATIVE_CONTROL' "$f" | tail -1) exit=$e" | tee -a "$EVID/summary.txt" |
| 41 | ( cd "$EVID" && sha256sum device.txt build.log summary.txt host.log chip-r*.log control-mutant.log > SHA256SUMS ) |
| 42 | if [ $fail = 0 ]; then echo "GPU_FP8_SLOTS_CHIP: PASS"; else echo "GPU_FP8_SLOTS_CHIP: FAIL"; exit 1; fi |