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 / GEMM-GENERAL-AB-20261027 / hold.sh

39 lines · 2143 bytes Raw Blame History
1#!/bin/bash
2# GemmGeneral chip hold for the served-shape A/B (AB-PLAN.md): flock, 18091 /health and compute apps before and after,
3# BOARD GPU-START/GPU-END, 14-minute cap. No new hold while the last anchored Main WINDOW-* line on BOARD is WINDOW-START,
4# and none while 18091 is not "status":"ok". Bounded: 3 h of waiting, then NOT_RUN on BOARD.
5# Pattern copied from handoffs/GemmTune/hold.sh.
6# usage: hold.sh <label> <logdir> <command...>
7set -u
8label=$1; logdir=$2; shift 2
9mkdir -p "$logdir"
10B=/home/drakestapleton/handoffs/BOARD.md
11window_open() { grep -E '^[0-9TZ:.-]+ Main: WINDOW-(START|END|ABORTED)' $B | tail -1 | grep -q 'WINDOW-START'; }
12live_ok() { curl -s -m 5 127.0.0.1:18091/health | grep -q '"status":"ok"'; }
13exec 9>/tmp/aien-gb10.lock
14deadline=$(( $(date +%s) + 10800 ))
15while :; do
16 if [ "$(date +%s)" -ge "$deadline" ]; then
17 echo "$(date -u +%FT%TZ) GemmGeneral: NOT_RUN $label (window open or 18091 not ok for 3 h)" >> $B; exit 75
18 fi
19 if window_open || ! live_ok; then sleep 30; continue; fi
20 if ! flock -w 900 9; then continue; fi
21 if window_open || ! live_ok; then flock -u 9; sleep 30; continue; fi
22 break
23done
24{
25 echo "# $label start $(date -u +%FT%TZ) load $(cat /proc/loadavg)"
26 echo "# health before: $(curl -s -m 5 127.0.0.1:18091/health)"
27 echo "# compute apps before: $(nvidia-smi --query-compute-apps=pid,process_name --format=csv,noheader | tr '\n' ';')"
28} > "$logdir/hold.log"
29echo "$(date -u +%FT%TZ) GemmGeneral: GPU-START $label (flock /tmp/aien-gb10.lock, <=14 min, beside live 35B; log $logdir)" >> $B
30timeout 840 "$@" > "$logdir/run.log" 2>&1
31rc=$?
32{
33 echo "# exit $rc end $(date -u +%FT%TZ)"
34 echo "# health after: $(curl -s -m 5 127.0.0.1:18091/health)"
35 echo "# compute apps after: $(nvidia-smi --query-compute-apps=pid,process_name --format=csv,noheader | tr '\n' ';')"
36} >> "$logdir/hold.log"
37apps=$(nvidia-smi --query-compute-apps=pid --format=csv,noheader | tr -d ' ' | sort -u | tr '\n' ' ')
38echo "$(date -u +%FT%TZ) GemmGeneral: GPU-END $label exit $rc; compute apps after: ${apps}; 18091 $(curl -s -m 5 127.0.0.1:18091/health | grep -o '"status":"[a-z]*"')" >> $B
39exit $rc