Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-train/blob/main/streams/math-training/run_retry.sh # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aien-train / streams / math-training / run_retry.sh` 11 lines ยท 451 bytes Raw Blame History 1 #!/bin/sh 2 # Rerun a GPU script when CUDA context creation fails on fragmented memory (cuDevicePrimaryCtxRetain OOM). 3 # Usage: run_retry.sh LOG cmd... Retries up to 30 times, 60 s apart, only for that specific startup failure. 4 log=$1; shift 5 i=0 6 while [ $i -lt 30 ]; do 7 "$@" > "$log" 2>&1 && exit 0 8 grep -q "cuDevicePrimaryCtxRetain" "$log" || exit 1 9 i=$((i+1)); echo "ctx-retry $i $(date -u +%H:%M:%SZ)" >> "$log.retries"; sleep 60 10 done 11 exit 1