-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubmit_all_params.sh
More file actions
executable file
·72 lines (58 loc) · 1.87 KB
/
submit_all_params.sh
File metadata and controls
executable file
·72 lines (58 loc) · 1.87 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
# Script to submit all hyperparameter combinations as parallel SLURM jobs
echo "========================================="
echo "HYPERPARAMETER SEARCH - PARALLEL SUBMISSION"
echo "========================================="
echo ""
# Create log directory
mkdir -p hyperparam_logs
# Define hyperparameter grid
BETAS=(1.0 3.0 5.0)
LAMBDAS=(0.005 0.01 0.02)
GAMMAS=(0.05 0.1 0.2)
# Count total combinations
TOTAL=$((${#BETAS[@]} * ${#LAMBDAS[@]} * ${#GAMMAS[@]}))
echo "Total combinations: ${TOTAL}"
echo ""
# Array to store job IDs
declare -a JOB_IDS
# Counter
COUNT=0
# Submit each combination
for BETA in "${BETAS[@]}"; do
for LAMBDA in "${LAMBDAS[@]}"; do
for GAMMA in "${GAMMAS[@]}"; do
COUNT=$((COUNT + 1))
# Create job name
JOB_NAME="hp_b${BETA}_l${LAMBDA}_g${GAMMA}"
echo "[$COUNT/$TOTAL] Submitting: Beta=${BETA}, Lambda=${LAMBDA}, Gamma=${GAMMA}"
# Submit job
JOB_ID=$(sbatch --parsable \
--job-name="${JOB_NAME}" \
sbatch_loss_hp_search.sh ${BETA} ${LAMBDA} ${GAMMA})
JOB_IDS+=("${JOB_ID}")
echo " → Job ID: ${JOB_ID}"
echo ""
# Optional: small delay to avoid overwhelming scheduler
sleep 0.5
done
done
done
echo "========================================="
echo "SUBMISSION COMPLETE"
echo "========================================="
echo "Submitted ${#JOB_IDS[@]} jobs"
echo ""
echo "Job IDs: ${JOB_IDS[@]}"
echo ""
echo "Monitor all jobs:"
echo " squeue -u \$USER"
echo ""
echo "Monitor specific job:"
echo " squeue -j JOB_ID"
echo ""
echo "Check job output:"
echo " tail -f hyperparam_logs/hp_b*_JOB_ID.out"
echo ""
echo "Results will be saved to: ./hyperparam_search_results/"
echo "========================================="