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

45 lines · 2647 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_matmul_api_chip.sh EVIDENCE_DIR [PHYSICS_DIR]
18# FB-1 cut 1b chip gate for omega_gpu_matmul_api (run through lanes.sh queue --heavy, never killed).
19# 1. parity sweep (cut-1 shapes + Llama shapes), host double reference, rel < 1e-5
20# 2. mutant sweep: wrong kernel (last K step dropped) must be caught on every shape
21# 3. resident GEMV timing: 1x2048x8192 and 1x8192x2048, median of 100 calls < 5 ms
22# 4. CTA budget experiment (I42): the same sweep subset at 128 and 256 CTAs, informational
23# Verdict line last: "GPU_MATMUL_API_CHIP: PASS|FAIL". Steps 1-3 decide, step 4 is recorded only.
24set -u
25EVID="${1:?evidence dir}"; PHYS="${2:-$HOME/workspace/hive-worktrees/qual-physics-6d7cf0d}"
26HERE="$(cd "$(dirname "$0")/.." && pwd)"
27mkdir -p "$EVID"
28cd "$HERE" || exit 2
29{
30 echo "start $(date -u +%FT%TZ) omega=$(git rev-parse HEAD) dirty=$(git status --porcelain | wc -l) physics=$PHYS"
31 uname -a; nvidia-smi --query-gpu=name,driver_version --format=csv,noheader 2>/dev/null
32} > "$EVID/device.txt"
33make PHYSICS_DIR="$PHYS" -j10 build/gpu_matmul_api_test > "$EVID/build.log" 2>&1 || { echo "GPU_MATMUL_API_CHIP: FAIL build"; exit 1; }
34T=./build/gpu_matmul_api_test
35fail=0
36$T --out "$EVID/receipt-sweep.json" 2>&1 | tee "$EVID/sweep.log"; [ "${PIPESTATUS[0]}" = 0 ] || fail=1
37$T --mutant --out "$EVID/receipt-mutant.json" 2>&1 | tee "$EVID/mutant.log"; [ "${PIPESTATUS[0]}" = 0 ] || fail=1
38$T --timing --out "$EVID/receipt-timing.json" 2>&1 | tee "$EVID/timing.log"; [ "${PIPESTATUS[0]}" = 0 ] || fail=1
39for b in 128 256; do
40 OMEGA_GPU_MATMUL_SHAPES="256,256,256;1,2048,8192;1,2048,128256" $T --cta-budget $b --out "$EVID/receipt-cta$b.json" 2>&1 | tee "$EVID/cta$b.log"
41 echo "cta budget $b exit ${PIPESTATUS[0]} (informational)" | tee -a "$EVID/cta$b.log"
42done
43echo "end $(date -u +%FT%TZ)" >> "$EVID/device.txt"
44(cd "$EVID" && sha256sum *.json *.log device.txt > SHA256SUMS)
45if [ $fail = 0 ]; then echo "GPU_MATMUL_API_CHIP: PASS"; else echo "GPU_MATMUL_API_CHIP: FAIL"; exit 1; fi