-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubmission_hvd.sh
executable file
·50 lines (34 loc) · 1.01 KB
/
submission_hvd.sh
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
localDir=`pwd`
run_file=$localDir/run_file_hvd.sh
submit_file=$localDir/submit_file_hvd.sh
program=$localDir/training_hvd.py
epochs=200
bs=16
name="Indents_"
for gpu in 1
do
for augment in 0
do
RESULT_DIR="$localDir/$name$gpu$augment"
mkdir -p ${RESULT_DIR}
cd ${RESULT_DIR}
if [ $gpu = 1 ]
then
tasks=1
node=1
else
tasks=2
node=$((${gpu}/2))
fi
batch=$((${gpu}*bs))
# adapting run file
sed -e "s|tag_program|${program}|g" ${run_file} |\
sed -e "s/\<tag_epoch\>/${epochs}/g"| \
sed -e "s/\<tag_batch\>/${batch}/g"| \
sed -e "s/\<tag_aug\>/${augment}/g" > script.sh
# adapting submit file
sed -e "s/\<tag_task\>/${tasks}/g" ${submit_file}|\
sed -e "s/\<tag_node\>/${node}/g" > sub_${node}.sh
sbatch sub_${node}.sh
done
done