-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_probe_sweep.sh
More file actions
executable file
·30 lines (25 loc) · 1.01 KB
/
run_probe_sweep.sh
File metadata and controls
executable file
·30 lines (25 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
# run_probe_sweep.sh: launches probe training jobs sequentially on specific GPUs
set -euo pipefail
export CUDA_VISIBLE_DEVICES=0,1,2,3
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
RUN_DDP="${SCRIPT_DIR}/run_ddp.sh"
JOBS=(
"--app pyine.apps.trainers.probe_trainer --nproc_per_node 4 -- +experiment=guardrail/v0_probe_moderate"
"--app pyine.apps.trainers.probe_trainer --nproc_per_node 4 -- +experiment=guardrail/v0_probe_strong"
"--app pyine.apps.trainers.probe_trainer --nproc_per_node 4 -- +experiment=guardrail/v0_probe_weak"
)
for job_idx in "${!JOBS[@]}"; do
echo ""
echo "========================================"
echo " Job $((job_idx + 1))/${#JOBS[@]}"
echo "========================================"
echo ""
# shellcheck disable=SC2086
bash "${RUN_DDP}" ${JOBS[$job_idx]}
job_exit=$?
echo ""
echo "[sweep] Job $((job_idx + 1))/${#JOBS[@]} finished with exit code ${job_exit}."
done
echo ""
echo "[sweep] All ${#JOBS[@]} jobs complete."