You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
600 B
30 lines
600 B
7 years ago
|
#! /usr/bin/env bash
|
||
|
|
||
|
BATCH_SIZE_PER_GPU=64
|
||
|
MIN_DURATION=6.0
|
||
|
MAX_DURATION=7.0
|
||
|
|
||
|
function join_by { local IFS="$1"; shift; echo "$*"; }
|
||
|
|
||
|
for NUM_GPUS in 16 8 4 2 1
|
||
|
do
|
||
|
DEVICES=$(join_by , $(seq 0 $(($NUM_GPUS-1))))
|
||
5 years ago
|
BATCH_SIZE=$(($BATCH_SIZE_PER_GPU))
|
||
7 years ago
|
|
||
|
CUDA_VISIBLE_DEVICES=$DEVICES \
|
||
|
python train.py \
|
||
|
--batch_size=$BATCH_SIZE \
|
||
5 years ago
|
--num_epoch=1 \
|
||
7 years ago
|
--test_off=True \
|
||
|
--min_duration=$MIN_DURATION \
|
||
|
--max_duration=$MAX_DURATION > tmp.log 2>&1
|
||
|
|
||
|
if [ $? -ne 0 ];then
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
5 years ago
|
cat tmp.log | grep "Time" | awk '{print "GPU Num: " "'"$NUM_GPUS"'" " Time: "$2}'
|
||
7 years ago
|
|
||
|
rm tmp.log
|
||
|
done
|