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/tests/omegallm/xcheck.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 / tests / omegallm / xcheck.sh` 52 lines ยท 2797 bytes Raw Blame History 1 #!/bin/sh 2 # Run the oracle self-test and every cross-check against one `ollm` binary. 3 # Usage: tests/omegallm/xcheck.sh OLLM LABEL OUTDIR [v0] 4 # DATA (env) = TinyStoriesV2-GPT4-valid.txt; WORK (env) = scratch dir for derived .bin files. 5 # Paths are logged exactly as given; pass relative ones so committed receipts name no private paths. 6 # The oracle's temporary checkpoints go under WORK/LABEL/tmp (OLLM_TMP) for the same reason. 7 # CORE (env, default 8) = the taskset core every check runs on. 8 # Writes OUTDIR/LABEL/{CHECK.json,CHECK.log,summary.tsv}. Exit 0 only if every check passed. 9 set -u 10 BIN=$1 LABEL=$2 OUT=$3/$2 MODE=${4:-} 11 ORACLE="$(dirname "$0")/oracle.py" 12 : "${DATA:?set DATA to TinyStoriesV2-GPT4-valid.txt}" "${WORK:?set WORK to a scratch dir}" 13 RUN="taskset -c ${CORE:-8} nice -n 19" 14 export PYTHONDONTWRITEBYTECODE=1 OLLM_TMP="$WORK/$2/tmp" 15 mkdir -p "$OUT" "$WORK/$LABEL" 16 SUM="$OUT/summary.tsv" 17 printf 'check\trc\tcommand\n' > "$SUM" 18 fail=0 19 one() { 20 name=$1; shift 21 echo "\$ $RUN python3 $*" > "$OUT/$name.log" 22 $RUN python3 "$@" >> "$OUT/$name.log" 2>&1 23 rc=$? 24 echo "rc=$rc" >> "$OUT/$name.log" 25 printf '%s\t%s\t%s\n' "$name" "$rc" "$RUN python3 $*" >> "$SUM" 26 [ "$rc" -eq 0 ] || fail=1 27 echo "$name rc=$rc" 28 } 29 sha256sum "$BIN" "$ORACLE" "$DATA" > "$OUT/sha256.txt" 30 one selftest "$ORACLE" selftest 31 one xprep "$ORACLE" xprep --ollm "$BIN" --data "$DATA" --outdir "$WORK/$LABEL" --receipt "$OUT/xprep.json" 32 # Later checks use the oracle's own prep output so that a prep defect cannot mask a model defect. 33 TRAIN="$WORK/$LABEL/oracle-train.bin" HELD="$WORK/$LABEL/oracle-held.bin" 34 if [ ! -s "$TRAIN" ] || [ ! -s "$HELD" ]; then 35 # record why every later check is about to fail, instead of leaving only their errors 36 printf '%s\t%s\t%s\n' xprep-output 1 "missing $TRAIN or $HELD" >> "$SUM" 37 fail=1 38 echo "xprep-output missing $TRAIN or $HELD" 39 fi 40 head -c 65536 "$TRAIN" > "$WORK/$LABEL/train64k.bin" 41 one xbase "$ORACLE" xbase --ollm "$BIN" --train "$TRAIN" --held "$HELD" --receipt "$OUT/xbase.json" 42 one xinit "$ORACLE" xinit --ollm "$BIN" --receipt "$OUT/xinit.json" 43 one xgrad "$ORACLE" xgrad --ollm "$BIN" --data "$WORK/$LABEL/train64k.bin" --receipt "$OUT/xgrad.json" 44 one xstep "$ORACLE" xstep --ollm "$BIN" --data "$WORK/$LABEL/train64k.bin" --receipt "$OUT/xstep.json" 45 one xeval "$ORACLE" xeval --ollm "$BIN" --held "$HELD" --receipt "$OUT/xeval.json" 46 if [ "$MODE" = v0 ]; then 47 one xinit-v0 "$ORACLE" xinit --cfg v0 --ollm "$BIN" --receipt "$OUT/xinit-v0.json" 48 one xgrad-v0 "$ORACLE" xgrad --cfg v0 --ollm "$BIN" --data "$TRAIN" --receipt "$OUT/xgrad-v0.json" 49 one xstep-v0 "$ORACLE" xstep --cfg v0 --ollm "$BIN" --data "$TRAIN" --receipt "$OUT/xstep-v0.json" 50 one xeval-v0 "$ORACLE" xeval --cfg v0 --ollm "$BIN" --held "$HELD" --receipt "$OUT/xeval-v0.json" 51 fi 52 exit $fail