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_decode_attn256_chip.sh
| 1 | #!/bin/bash |
| 2 | # run_gpu_decode_attn256_chip.sh EVIDENCE_DIR [PHYSICS_DIR] |
| 3 | # Qwen3.8-27B chip gate for omega_gpu_decode_attn256_api (omega-mv#544: one-launch decode attention, head_dim 256, 24 q / 4 kv |
| 4 | # heads, partial RoPE by permutation, in-kernel KV append). |
| 5 | # Caller holds the GB10 lock: flock /tmp/aien-gb10.lock tools/run_gpu_decode_attn256_chip.sh EVID |
| 6 | # 0. host proofs first (never hardware results): --host-only (partial RoPE rows, the permutation, reference sanity, codegen |
| 7 | # budgets, refusals) and --sim (warp-simulator parity on 9 contexts incl. rotary 256, multi-split and 2 chunks per CTA, mutants 1-5) |
| 8 | # 1. baseline: the already-proven matmul API chip timing (chip and session path work before the new kernel is judged) |
| 9 | # 2. main: parity against the double reference at contexts 1, 7, 256, 301 (sharp q), 1024, 4096, 8192, 32768; the appended |
| 10 | # K/V rows read back; second call bit-identical; out_scale 2^64 path; mutants 1-5 at context 301; chip medians and |
| 11 | # GB/s on the K+V bytes streamed, host caches evicted before each timing loop |
| 12 | # 3. one variable per run, informational: --no-evict (host caches warm: the flattering number), --depth 1 (shallowest |
| 13 | # prefetch), --per-split 1024 (4 chunks per CTA, a quarter of the CTAs), --max-pos 131072 (the 512 MiB per-layer |
| 14 | # cache of the real model: allocation + parity at context 131072) |
| 15 | # Verdict line last: "GPU_DECODE_ATTN256_CHIP: PASS|FAIL". Steps 0 and 2 decide; 1 and 3 are recorded. |
| 16 | set -u |
| 17 | EVID="${1:?evidence dir}"; PHYS="${2:-$HOME/workspace/physics-own30b-k}" |
| 18 | HERE="$(cd "$(dirname "$0")/.." && pwd)" |
| 19 | mkdir -p "$EVID" |
| 20 | cd "$HERE" || exit 2 |
| 21 | { |
| 22 | 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=$(cat physics.lock 2>/dev/null | head -1)" |
| 23 | uname -a; nvidia-smi --query-gpu=name,driver_version --format=csv,noheader 2>/dev/null; free -g | head -2 |
| 24 | } > "$EVID/device.txt" |
| 25 | make PHYSICS_DIR="$PHYS" -j10 build/gpu_decode_attn256_test build/gpu_matmul_api_test > "$EVID/build.log" 2>&1 || { echo "GPU_DECODE_ATTN256_CHIP: FAIL build"; exit 1; } |
| 26 | T=./build/gpu_decode_attn256_test |
| 27 | fail=0 |
| 28 | $T --host-only 2>&1 | tee "$EVID/host-only.log"; [ "${PIPESTATUS[0]}" = 0 ] || fail=1 |
| 29 | $T --sim 2>&1 | tee "$EVID/sim.log"; [ "${PIPESTATUS[0]}" = 0 ] || fail=1 |
| 30 | ./build/gpu_matmul_api_test --timing --out "$EVID/receipt-baseline-matmul.json" 2>&1 | tee "$EVID/baseline-matmul.log" |
| 31 | echo "baseline exit ${PIPESTATUS[0]} (recorded)" | tee -a "$EVID/baseline-matmul.log" |
| 32 | $T --reps 20 --out "$EVID/receipt-main.json" 2>&1 | tee "$EVID/main.log"; [ "${PIPESTATUS[0]}" = 0 ] || fail=1 |
| 33 | $T --reps 20 --no-evict --out "$EVID/receipt-noevict.json" 2>&1 | tee "$EVID/noevict.log"; echo "no-evict exit ${PIPESTATUS[0]} (informational)" | tee -a "$EVID/noevict.log" |
| 34 | $T --reps 20 --depth 1 --out "$EVID/receipt-depth1.json" 2>&1 | tee "$EVID/depth1.log"; echo "depth 1 exit ${PIPESTATUS[0]} (informational)" | tee -a "$EVID/depth1.log" |
| 35 | $T --reps 20 --per-split 1024 --out "$EVID/receipt-persplit1024.json" 2>&1 | tee "$EVID/persplit1024.log"; echo "per-split 1024 exit ${PIPESTATUS[0]} (informational)" | tee -a "$EVID/persplit1024.log" |
| 36 | $T --reps 5 --max-pos 131072 --only "context 131072" --out "$EVID/receipt-maxpos131072.json" 2>&1 | tee "$EVID/maxpos131072.log"; echo "max-pos 131072 exit ${PIPESTATUS[0]} (informational)" | tee -a "$EVID/maxpos131072.log" |
| 37 | |
| 38 | echo "end $(date -u +%FT%TZ)" >> "$EVID/device.txt" |
| 39 | (cd "$EVID" && sha256sum *.json *.log device.txt > SHA256SUMS) |
| 40 | if [ $fail = 0 ]; then echo "GPU_DECODE_ATTN256_CHIP: PASS"; else echo "GPU_DECODE_ATTN256_CHIP: FAIL"; exit 1; fi |