summaryrefslogtreecommitdiff
path: root/scripts/run_ladder.sh
diff options
context:
space:
mode:
authoryurenh <blackhao0426@gmail.com>2026-08-31 18:33:06 -0500
committeryurenh <blackhao0426@gmail.com>2026-08-31 18:33:06 -0500
commitf68f6b00f047d9412113d7c2627bd7f6e96f2d62 (patch)
tree611ee8daf2b7ad04c2492ee3521d31c01a1f96b7 /scripts/run_ladder.sh
parent5e5f56cff99fe017c08d56d1303773d1299c0e38 (diff)
env bootstrap (optional venv) + self-check in the ladder runner
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GkgLsACEF6CCP7EUfA5fZe
Diffstat (limited to 'scripts/run_ladder.sh')
-rwxr-xr-xscripts/run_ladder.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/run_ladder.sh b/scripts/run_ladder.sh
index 65b43a9..17219bd 100755
--- a/scripts/run_ladder.sh
+++ b/scripts/run_ladder.sh
@@ -30,7 +30,15 @@ EXTRA="--set ${TOKENS:+tokens=$TOKENS} ${SET:-}"
echo "== zbp-scaling ladder: sizes=[$SIZES] arms=[$ARMS] nproc=$NPROC data=$DATA out=$OUT ${TOKENS:+tokens=$TOKENS}"
[ "$NPROC" -ge 1 ] || { echo "no GPUs detected; set NPROC"; exit 1; }
-python -c "import zbp_scaling" 2>/dev/null || pip install -e . -q
+# --- environment bootstrap: current env first; VENV=1 creates ./.venv (fresh nodes) ---
+PY=${PY:-python3}
+if [ "${VENV:-0}" = 1 ]; then
+ [ -d .venv ] || "$PY" -m venv .venv
+ . .venv/bin/activate
+fi
+python -c "import zbp_scaling" 2>/dev/null || pip install -e . -q || {
+ echo "pip install failed; on managed nodes run with VENV=1 (creates ./.venv) or install into your conda env"; exit 1; }
+python scripts/env_check.py || exit 1
if [ ! -f "$DATA/train.bin" ]; then
echo "== preparing data ($PREP_TOKENS tokens -> $DATA) — run this on the training node"