|
1 |
| - |
2 | 1 | #!usr/bin/env bash
|
3 | 2 |
|
4 |
| -export BENCHMARK_ROOT=/workspace |
5 |
| -run_env=$BENCHMARK_ROOT/run_env |
6 |
| -log_date=`date "+%Y.%m%d.%H%M%S"` |
7 |
| -frame=paddle2.1.3 |
8 |
| -cuda_version=10.2 |
9 |
| -save_log_dir=${BENCHMARK_ROOT}/logs/${frame}_${log_date}_${cuda_version}/ |
10 |
| - |
11 |
| -if [[ -d ${save_log_dir} ]]; then |
12 |
| - rm -rf ${save_log_dir} |
13 |
| -fi |
14 |
| - |
15 |
| -# this for update the log_path coding mat |
16 |
| -export TRAIN_LOG_DIR=${save_log_dir}/train_log |
17 |
| -mkdir -p ${TRAIN_LOG_DIR} |
18 |
| -log_path=${TRAIN_LOG_DIR} |
19 |
| - |
20 |
| -################################# 配置python, 如: |
21 |
| -rm -rf $run_env |
22 |
| -mkdir $run_env |
23 |
| -echo `which python3.7` |
24 |
| -ln -s $(which python3.7)m-config $run_env/python3-config |
25 |
| -ln -s $(which python3.7) $run_env/python |
26 |
| -ln -s $(which pip3.7) $run_env/pip |
27 |
| - |
28 |
| -export PATH=$run_env:${PATH} |
29 |
| -cd $BENCHMARK_ROOT |
30 |
| -pip install -v -e . |
31 |
| - |
| 3 | +export log_path=${LOG_PATH_INDEX_DIR:-$(pwd)} |
32 | 4 |
|
33 | 5 | function parse_yaml {
|
34 | 6 | local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
|
@@ -79,17 +51,17 @@ for model_mode in ${model_mode_list[@]}; do
|
79 | 51 | for fp_item in ${fp_item_list[@]}; do
|
80 | 52 | for bs_item in ${bs_list[@]}
|
81 | 53 | do
|
82 |
| - echo "index is speed, 1gpus, begin, ${model_name}" |
| 54 | + echo "index is speed, 1gpus, begin, ${model_mode}" |
83 | 55 | run_mode=sp
|
84 |
| - CUDA_VISIBLE_DEVICES=0 benchmark/run_benchmark.sh ${run_mode} ${bs_item} ${fp_item} ${mode} ${max_iter} ${model_mode} ${config} ${log_interval} ${profile} # (5min) |
| 56 | + CUDA_VISIBLE_DEVICES=0 benchmark/run_benchmark.sh ${run_mode} ${bs_item} ${fp_item} ${mode} ${max_iter} ${model_mode} ${config} ${log_interval} ${profile} | tee ${log_path}/gan_dygraph_${model_mode}_${run_mode}_bs${bs_item}_${fp_item}_speed_1gpus 2>&1 # (5min) |
85 | 57 | sleep 60
|
86 |
| - echo "index is speed, 8gpus, run_mode is multi_process, begin, ${model_name}" |
| 58 | + echo "index is speed, 8gpus, run_mode is multi_process, begin, ${model_mode}" |
87 | 59 | run_mode=mp
|
88 | 60 | basicvsr_name=basicvsr
|
89 | 61 | if [ ${model_mode} = ${basicvsr_name} ]; then
|
90 |
| - CUDA_VISIBLE_DEVICES=0,1,2,3 bash benchmark/run_benchmark.sh ${run_mode} ${bs_item} ${fp_item} ${mode} ${max_iter} ${model_mode} ${config} ${log_interval} ${profile} |
| 62 | + CUDA_VISIBLE_DEVICES=0,1,2,3 bash benchmark/run_benchmark.sh ${run_mode} ${bs_item} ${fp_item} ${mode} ${max_iter} ${model_mode} ${config} ${log_interval} ${profile} | tee ${log_path}/gan_dygraph_${model_mode}_${run_mode}_bs${bs_item}_${fp_item}_speed_4gpus4p 2>&1 |
91 | 63 | else
|
92 |
| - CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 bash benchmark/run_benchmark.sh ${run_mode} ${bs_item} ${fp_item} ${mode} ${max_iter} ${model_mode} ${config} ${log_interval} ${profile} |
| 64 | + CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 bash benchmark/run_benchmark.sh ${run_mode} ${bs_item} ${fp_item} ${mode} ${max_iter} ${model_mode} ${config} ${log_interval} ${profile} | tee ${log_path}/gan_dygraph_${model_mode}_${run_mode}_bs${bs_item}_${fp_item}_speed_8gpus8p 2>&1 |
93 | 65 | fi
|
94 | 66 | sleep 60
|
95 | 67 | done
|
|
0 commit comments