interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / evidence / ATTN-GENERAL-20261027-4d51f91f / chip.sh

46 lines · 2843 bytes Raw Blame History
1#!/bin/bash
2# AttnGeneral chip hold (diagnostic driver, not product code). One flock hold, <= 14 min, beside the live 35B.
3set -u
4B=/home/drakestapleton/handoffs/BOARD.md
5R=/home/drakestapleton/work/AttnGeneral/cudapp
6M=/home/drakestapleton/work/AttnGeneral/main-c30c0be
7ts() { date -u +%FT%TZ; }
8post() { echo "$(ts) AttnGeneral: $*" >> "$B"; }
9health() { apps=$(nvidia-smi --query-compute-apps=pid --format=csv,noheader | tr '\n' ' '); h=$(curl -s -m 2 127.0.0.1:18091/health); echo "apps=[$apps] health=$h"; }
10window_open() { # 1 if the last Main WINDOW line is START
11 l=$(grep -E '^[0-9TZ:.-]+ Main: WINDOW-(START|END|ABORTED)' "$B" | tail -n 1); [[ "$l" == *WINDOW-START* ]]; }
12exec 9>/tmp/aien-gb10.lock
13for try in 1 2 3 4 5 6; do
14 if window_open; then echo "window open, waiting"; sleep 300; continue; fi
15 flock -w 900 9 && break
16done
17flock -n 9 || { echo "lock not acquired"; exit 3; }
18if window_open; then echo "window opened while waiting; releasing"; exit 3; fi
19pre=$(health); echo "pre: $pre"
20case "$pre" in *"apps=[79557 ]"*'"status":"ok"'*) ;; *) post "NOT_RUN chip hold: pre-health not clean ($pre)"; exit 4;; esac
21HEAD=$(git -C "$R" rev-parse --short=8 HEAD)
22E=$R/evidence/ATTN-GENERAL-20261027-$HEAD; mkdir -p "$E"
23post "GPU-START attn-general chip (flock /tmp/aien-gb10.lock, <=14 min, beside live 35B; evidence $E)"
24START=$(date +%s)
25cd "$R"
26echo "$pre" > "$E/health_pre.txt"
27./build/gpu_attention_test --general --out "$E/general.json" > "$E/general.log" 2>&1; echo "general rc=$?" | tee -a "$E/rc.txt"
28./build/gpu_attention_test --out "$E/hd64.json" > "$E/hd64.log" 2>&1; echo "hd64 rc=$?" | tee -a "$E/rc.txt"
29./build/gpu_attention_test --hd 128 --out "$E/hd128.json" > "$E/hd128.log" 2>&1; echo "hd128 rc=$?" | tee -a "$E/rc.txt"
30./build/gpu_attention_test --sweep --out "$E/sweep.json" > "$E/sweep.log" 2>&1; echo "sweep rc=$?" | tee -a "$E/rc.txt"
31# A/B per AB-PLAN.md
32D=$E/ab; mkdir -p "$D"
33( while :; do t=$(date +%s%N); h=$(curl -s -m 0.5 127.0.0.1:18091/health); f=$(printf '%s' "$h" | grep -o '"in_flight":[0-9]*' | cut -d: -f2); echo "$t ${f:--1}"; sleep 0.03; done ) > "$D/inflight.log" &
34P=$!; sleep 0.3
35for pair in 1 2 3 4 5 6 7 8 9 10; do
36 if [ $(( $(date +%s) - START )) -gt 780 ]; then echo "time cap reached at pair $pair" >> "$D/runs.tsv"; break; fi
37 if (( pair % 2 )); then order="A B"; else order="B A"; fi
38 for arm in $order; do
39 bin=$R/build/gpu_attention_test; [ $arm = A ] && bin=$M/build/gpu_attention_test
40 t0=$(date +%s%N); "$bin" --timing --out "$D/$arm$pair.json" > "$D/$arm$pair.log" 2>&1; rc=$?; t1=$(date +%s%N)
41 echo -e "$arm\t$pair\t$t0\t$t1\t$rc" >> "$D/runs.tsv"
42 done
43done
44sleep 0.3; kill $P; wait $P 2>/dev/null
45post_h=$(health); echo "$post_h" > "$E/health_post.txt"; echo "post: $post_h"
46post "GPU-END attn-general chip; $(tr '\n' ' ' < "$E/rc.txt"); post: $post_h"