penfever's picture
Campaign artifacts: configs, scripts, curves, evidence, preserved cleanup logs, analyses
3b8b7ae verified
Raw
History Blame Contribute Delete
3.08 kB
#!/usr/bin/env bash
# Launch one jupiter-tasktrove-dapo arm on Jupiter (JSC) via the OT-Agent HPC launcher.
# Runs ON JUPITER, not from the Mac: hpc.launch and the config must be on the cluster.
# ./launch.sh d1 [--dry-run]
set -uo pipefail
ARM="${1:?usage: $0 <arm> e.g. $0 d1}"
DRY="${2:-}"
DCFT_DIR=/e/scratch/jureap59/feuer1/OpenThoughts-Agent
CFG_ROOT=/e/scratch/jureap59/feuer1/jupiter-tasktrove-dapo/configs
PY=/e/scratch/jureap59/feuer1/miniforge3/envs/otagent/bin/python
MODEL=Qwen/Qwen3-Coder-30B-A3B-Instruct
# laion/codeforces-v2 was deleted from HF; the versioned replacement lives in
# open-thoughts/TaskTrove at laion__codeforces-v3/tasks.parquet (repo sha 71217c0f4a2f,
# tasks declare [environment] storage_mb = 4096 so Daytona sandboxes stop hitting ENOSPC).
# resolve_rl_train_data does not understand org/repo::subdir selectors (escalated
# 2026-08-30), so the subdir is pre-extracted on Jupiter and passed as a local path,
# which the launcher forwards verbatim. Extracted on a COMPUTE node to /e/data1, not
# $SCRATCH/tasks: login-node small-file creates serialize at ~1.3 s/file (cxiWaitEventWait).
TRAIN_DATA='["/e/data1/datasets/playground/ot-baf/tasks/laion__codeforces-v3"]'
EXPERIMENTS_DIR=/e/data1/datasets/playground/ot-baf
# 6 by default; D3/D4 launch with NODES=8 (owner 2026-08-28: 8 inference engines at TP2 = 4
# inference nodes on top of the fixed 4 policy nodes).
NODES="${NODES:-6}"
# WORKDIR guard: universal_rl.sbatch resolves WORKDIR from DCFT_PRIVATE -> DCFT -> $PWD.
cd "$DCFT_DIR" || { echo "cannot cd to $DCFT_DIR" >&2; exit 1; }
export DCFT="$PWD"
# otagent env, NOT the RL venv: task extraction imports google.cloud.storage.
[ -x "$PY" ] || { echo "otagent python missing at $PY" >&2; exit 1; }
# Resolve arm -> config by prefix, not by a hardcoded objective suffix: arms are named for what
# they are (jtd_d1_codeforces_dapo, jtd_d0_codeforces_grpo), so the suffix varies per arm.
CFG="$(ls "$CFG_ROOT"/jtd_${ARM}_codeforces_*.yaml 2>/dev/null | head -1)"
[ -n "$CFG" ] && [ -f "$CFG" ] || { echo "no config matching $CFG_ROOT/jtd_${ARM}_codeforces_*.yaml — rsync artifacts/ to Jupiter first" >&2; exit 1; }
[ "$(ls "$CFG_ROOT"/jtd_${ARM}_codeforces_*.yaml 2>/dev/null | wc -l)" -eq 1 ] || { echo "arm '$ARM' matches more than one config; disambiguate" >&2; exit 1; }
echo "arm: $ARM"
echo "repo HEAD: $(git rev-parse --short HEAD) ($(git rev-parse --abbrev-ref HEAD))"
echo "SkyRL HEAD: $(cd SkyRL && git rev-parse --short HEAD) ($(cd SkyRL && git rev-parse --abbrev-ref HEAD))"
echo "config: $CFG"
# NO --reservation: reformo is an ACCOUNT, already hardwired via #SBATCH --account.
cmd=( "$PY" -m hpc.launch --job_type rl
--rl_config "$CFG"
--model_path "$MODEL"
--train_data "$TRAIN_DATA"
--num_nodes "$NODES"
--time_limit 11:59:00
--max_restarts 5
--experiments_dir "$EXPERIMENTS_DIR"
--job_name "jtd-${ARM}" )
printf 'command: '; printf '%q ' "${cmd[@]}"; printf '\n'
[ "$DRY" = "--dry-run" ] && { echo "--dry-run: not submitting"; exit 0; }
"${cmd[@]}"