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 / ab2.sh

31 lines · 1903 bytes Raw Blame History
1#!/bin/bash
2# AttnGeneral A/B v2 (diagnostic driver). One flock hold, beside the live 35B; defers to a Main WINDOW.
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() { l=$(grep -E '^[0-9TZ:.-]+ Main: WINDOW-(START|END|ABORTED)' "$B" | tail -n 1); [[ "$l" == *WINDOW-START* ]]; }
11exec 9>/tmp/aien-gb10.lock
12window_open && { echo "window open"; exit 3; }
13flock -w 900 9 || { echo "lock not acquired"; exit 3; }
14window_open && { echo "window opened"; exit 3; }
15pre=$(health); echo "pre: $pre"
16case "$pre" in *"apps=[79557 ]"*'"status":"ok"'*) ;; *) post "NOT_RUN ab2: pre-health not clean ($pre)"; exit 4;; esac
17D=$(ls -d $R/evidence/ATTN-GENERAL-20261027-*)/ab2; mkdir -p "$D"
18post "GPU-START attn-general ab2 (flock, <=5 min, beside live 35B; $D)"
19( 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" &
20P=$!; sleep 0.3
21for pair in $(seq 1 40); do
22 if (( pair % 2 )); then order="A B"; else order="B A"; fi
23 for arm in $order; do
24 bin=$R/build/gpu_attention_test; [ $arm = A ] && bin=$M/build/gpu_attention_test
25 t0=$(date +%s%N); "$bin" --timing --out "$D/$arm$pair.json" > "$D/$arm$pair.log" 2>&1; rc=$?; t1=$(date +%s%N)
26 echo -e "$arm\t$pair\t$t0\t$t1\t$rc" >> "$D/runs.tsv"
27 done
28done
29sleep 0.3; kill $P; wait $P 2>/dev/null
30post_h=$(health); echo "$post_h" > "$D/health_post.txt"; echo "$pre" > "$D/health_pre.txt"; echo "post: $post_h"
31post "GPU-END attn-general ab2; post: $post_h"