Download code/train_twin_hyper_sweep_long.sh from fhyfhy/Implicit-Reasoning-checkpoints: direct link, hf CLI and curl.
- Browser
- Download file 1.84 kB
-
https://huggingface.co/fhyfhy/Implicit-Reasoning-checkpoints/resolve/main/code/train_twin_hyper_sweep_long.sh
- Command line
-
hf download hf://fhyfhy/Implicit-Reasoning-checkpoints/code/train_twin_hyper_sweep_long.sh
-
curl -L -o train_twin_hyper_sweep_long.sh https://huggingface.co/fhyfhy/Implicit-Reasoning-checkpoints/resolve/main/code/train_twin_hyper_sweep_long.sh
1.84 kB
| # Long-training node: two 4-GPU DDP runs on the two-hop dataset. | |
| # GPUs 0-3: vanillaloop num-stages=1 answer loss 100k optimizer steps | |
| # GPUs 4-7: vanillaloop num-stages=2 answer loss 100k optimizer steps | |
| # Run names get the extra suffix "long_training". | |
| # | |
| # Usage: | |
| # ./train_twin_hyper_sweep_long.sh | |
| # ./train_twin_hyper_sweep_long.sh --max-steps 50000 # extra args forwarded to both | |
| set -euo pipefail | |
| cd "$(dirname "${BASH_SOURCE[0]}")" | |
| DATA_DIR="data/twin_twohop_truood_diff.500.50.10" | |
| MAX_STEPS=100000 | |
| LOSS="answer" | |
| SUFFIX="long_training" | |
| EXTRA_ARGS=() | |
| while [[ $# -gt 0 ]]; do | |
| case "$1" in | |
| --data) DATA_DIR="$2"; shift 2 ;; | |
| --max-steps) MAX_STEPS="$2"; shift 2 ;; | |
| *) EXTRA_ARGS+=("$1"); shift 1 ;; | |
| esac | |
| done | |
| # num_stages gpu_list master_port | |
| CONFIGS=( | |
| "1 0,1,2,3 29500" | |
| "2 4,5,6,7 29501" | |
| ) | |
| LOG_DIR="outputs/sweep_long.$(date +%Y%m%d_%H%M%S)" | |
| mkdir -p "$LOG_DIR" | |
| echo "Logs: $LOG_DIR" | |
| PIDS=() | |
| LABELS=() | |
| for c in "${CONFIGS[@]}"; do | |
| read -r STAGES GPUS PORT <<< "$c" | |
| LABEL="gpus${GPUS//,/}.vanillaloop.m${STAGES}" | |
| LOG="$LOG_DIR/${LABEL}.log" | |
| echo "[launch] GPUs $GPUS: vanillaloop num-stages=$STAGES max-steps=$MAX_STEPS loss=$LOSS -> $LOG" | |
| ./train_twin_hyper.sh \ | |
| --gpu "$GPUS" \ | |
| --master-port "$PORT" \ | |
| --data "$DATA_DIR" \ | |
| --loop-scheme vanillaloop \ | |
| --num-stages "$STAGES" \ | |
| --loss-compute-method "$LOSS" \ | |
| --max-steps "$MAX_STEPS" \ | |
| --run-name-suffix "$SUFFIX" \ | |
| "${EXTRA_ARGS[@]+"${EXTRA_ARGS[@]}"}" \ | |
| > "$LOG" 2>&1 & | |
| PIDS+=($!) | |
| LABELS+=("$LABEL") | |
| done | |
| echo "All ${#PIDS[@]} runs launched; waiting..." | |
| FAIL=0 | |
| for i in "${!PIDS[@]}"; do | |
| if wait "${PIDS[$i]}"; then | |
| echo "[done] ${LABELS[$i]}" | |
| else | |
| echo "[FAILED] ${LABELS[$i]} (see $LOG_DIR/${LABELS[$i]}.log)" >&2 | |
| FAIL=1 | |
| fi | |
| done | |
| exit "$FAIL" | |