aien-train
AIEN training programme: language-model history, GB10 constraints and the route to training on the project engine. Plans and runnable checks are distinguished.
Brought by drakestapleton
aien-train / streams / own-fp4 / race4.sh
| 1 | #!/bin/bash |
| 2 | # race4.sh (L284 oracle): like race2.sh, but every run holds /tmp/aien-gb10.lock (shared GPU rule, L182 note 2026-10-20) |
| 3 | # so locked timing measurements by other jobs stay valid; the lock is released between runs. Usage: race4.sh "recipe:seed[:extra] ..." |
| 4 | D=$HOME/workspace/aien-train-own-fp4-data; H=$(cd "$(dirname "$0")" && pwd); PY=$HOME/.venv/bin/python |
| 5 | mkdir -p $D/runs |
| 6 | for item in $1; do |
| 7 | IFS=: read -r rec seed extra <<<"$item"; out=$D/runs/$rec-s$seed |
| 8 | [ -f $out/result.json ] && { echo "skip $out"; continue; } |
| 9 | for try in 1 2 3 4 5 6; do |
| 10 | echo "$(date -u +%H:%MZ) waiting for lock ($rec)" |
| 11 | flock -x /tmp/aien-gb10.lock bash -c " |
| 12 | until timeout 120 $PY -I -c \"import torch; torch.ones(1,device='cuda'); assert torch.cuda.mem_get_info()[0] > 6e9\" >/dev/null 2>&1; do echo \"\$(date -u +%H:%MZ) waiting for GPU ($rec)\"; sleep 60; done |
| 13 | echo \"\$(date -u +%H:%MZ) start $rec seed $seed try $try\" |
| 14 | nice -n 10 $PY -I $H/train.py --recipe $rec --seed $seed --out $out $extra > $out.log 2>&1" |
| 15 | rc=$? |
| 16 | echo "$(date -u +%H:%MZ) end $rec rc=$rc $(tail -1 $out.log | cut -c1-200)" |
| 17 | [ $rc = 0 ] && break |
| 18 | grep -q "cuDevicePrimaryCtxRetain\|out of memory" $out.log || break |
| 19 | sleep 60 |
| 20 | done |
| 21 | done |