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 / race.sh
| 1 | #!/bin/bash |
| 2 | # race.sh (L284 oracle): run recipes one after another on the shared GPU; each waits until a CUDA context can be made |
| 3 | # (two 27B servers on this box sometimes leave none). Usage: race.sh "recipe:seed[:extra args] ..." |
| 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 | until grep -q "^train " $D/prep.log 2>/dev/null; do sleep 30; done |
| 7 | for item in $1; do |
| 8 | IFS=: read -r rec seed extra <<<"$item"; out=$D/runs/$rec-s$seed |
| 9 | [ -f $out/result.json ] && { echo "skip $out"; continue; } |
| 10 | 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 120; done |
| 11 | echo "$(date -u +%H:%MZ) start $rec seed $seed" |
| 12 | nice -n 10 $PY -I $H/train.py --recipe $rec --seed $seed --out $out $extra > $out.log 2>&1; rc=$? |
| 13 | echo "$(date -u +%H:%MZ) end $rec rc=$rc $(tail -1 $out.log | cut -c1-200)" |
| 14 | done |