penfever's picture
Campaign artifacts: configs, scripts, curves, evidence, preserved cleanup logs, analyses
3b8b7ae verified
Raw
History Blame Contribute Delete
3.87 kB
#!/bin/bash
# Compose-only validation of every arm's Hydra override list, in the real container.
#
# WHY THIS EXISTS. On 2026-08-20 all four arms were config-valid, schema-valid and diffed cleanly
# against each other, and the first link still died 12 minutes in on
# hydra.errors.ConfigCompositionException: Could not append to config.
# An item is already at 'terminal_bench_config.trace_upload.enabled'.
# A config that parses is not a config that composes, and an arm-vs-arm diff cannot catch a fault
# that every arm shares. This runs the launcher's real dry-run, extracts the real override list,
# and composes it against the real ppo_base_config inside the real container -- with no GPUs, no
# Ray, and no allocation. Run it after any config change and after any SkyRL sync, before
# submitting anything.
#
# Prints one line per arm. Anything other than COMPOSE OK on all four is a stop.
S=/e/scratch/jureap59/feuer1
SK=$S/OpenThoughts-Agent/SkyRL
OTA=$S/OpenThoughts-Agent
PY=$S/miniforge3/envs/otagent/bin/python
CFGROOT=$S/jupiter-tasktrove-dapo/configs
OUT=$S/_compose_check
rm -rf $OUT && mkdir -p $OUT
cd $OTA || exit 1
export DCFT=$PWD
for ARM in ${ARMS:-d0 d1 d2 d3}; do
CFG=$(ls $CFGROOT/jtd_${ARM}_codeforces_*.yaml | head -1)
# The launcher collision-renames an existing dry-run dir (cchk-d2__dryrun_2, _3, ...) and this
# script reads the base path, so a stale JSON from the FIRST run was being re-composed on every
# later run (caught 2026-08-21: l_max showed 4096 after the config said 32768). Clear them first.
rm -rf /e/data1/datasets/playground/ot-baf/cchk-${ARM}__dryrun /e/data1/datasets/playground/ot-baf/cchk-${ARM}__dryrun_*
$PY -m hpc.launch --job_type rl --rl_config "$CFG" \
--model_path Qwen/Qwen3-Coder-30B-A3B-Instruct \
--train_data '["/e/data1/datasets/playground/ot-baf/tasks/laion__codeforces-v3"]' --num_nodes "${NODES:-6}" --time_limit 11:59:00 \
--max_restarts 5 --experiments_dir /e/data1/datasets/playground/ot-baf \
--job_name cchk-$ARM --dry_run > $OUT/$ARM.launch.log 2>&1
J=/e/data1/datasets/playground/ot-baf/cchk-${ARM}__dryrun/configs/cchk-${ARM}_rl_config.json
$PY -c "
import json,sys
d=json.load(open('$J'))
open('$OUT/${ARM}.args','w').write('\n'.join(d['skyrl_hydra_args']))
" || { echo "$ARM: dry-run produced no config"; continue; }
done
export ARMS="${ARMS:-d0 d1 d2 d3}"
apptainer exec --overlay $S/containers/skyrl_titan_overlay.img:ro \
--env ARMS="$ARMS" --env PYTHONPATH="$S/sif_pydeps_titan_a1fdd7e:$S/sif_pydeps:$S/sif_pydeps_reasoning_gym_0125:$SK:$SK/skyrl-train:$SK/skyrl-gym:$S/harbor/src:$S/harbor:$OTA" \
$S/containers/skyrl_megatron_vllm0202rc0_r5.sif python - <<'PY'
import os, hydra
from hydra import compose, initialize_config_dir
from skyrl_train.entrypoints.terminal_bench import config_dir
for arm in os.environ.get("ARMS", "d0 d1 d2 d3").split():
path = f"/e/scratch/jureap59/feuer1/_compose_check/{arm}.args"
if not os.path.exists(path):
print(f"{arm}: NO ARGS FILE"); continue
overrides = [l for l in open(path).read().splitlines() if l.strip()]
try:
with initialize_config_dir(config_dir=config_dir, version_base=None):
cfg = compose(config_name="ppo_base_config", overrides=overrides)
g = cfg.generator
print(f"{arm}: COMPOSE OK n_overrides={len(overrides)} "
f"eps_hi={cfg.trainer.algorithm.eps_clip_high} "
f"dyn={cfg.trainer.algorithm.dynamic_sampling.type} "
f"filt={g.apply_overlong_filtering} "
f"shape={g.trajectory_reward_shaping.enabled} "
f"l_max={g.trajectory_reward_shaping.overlong.l_max} "
f"l_cache={g.trajectory_reward_shaping.overlong.l_cache} "
f"logger={cfg.trainer.logger}")
except Exception as e:
print(f"{arm}: COMPOSE FAIL {type(e).__name__}: {e}")
PY