提交 430fbd5d 编写于 作者: R root 提交者: Tingquan Gao

tipc: support fp32/fp16 training benchmark of PP-Shitu

上级 a7f12404
......@@ -184,17 +184,30 @@ for batch_size in ${batch_size_list[*]}; do
# At least 25 log number would be good to calculate ips for benchmark system.
# So the copy number for train_list is as follows:
total_batch_size=`echo $[$batch_size*${device_num:1:1}*${device_num:3:3}]`
copy_num=`echo $[$total_batch_size/200]`
if [[ $copy_num -gt 1 ]];then
if [[ $model_name == *GeneralRecognition* ]]; then
cd dataset/
train_list_length=`cat train_reg_all_data.txt | wc -l`
copy_num=`echo $[25*10*$total_batch_size/$train_list_length]`
if [[ $copy_num -gt 1 ]];then
rm -rf train_reg_all_data.txt
for ((i=1; i <=$copy_num; i++));do
cat tipc_shitu_demo_data/demo_train.txt >> train_reg_all_data.txt
done
fi
cd ..
else
cd dataset/ILSVRC2012
rm -rf train_list.txt
for ((i=1; i <=$copy_num; i++));do
cat val_list.txt >> train_list.txt
done
train_list_length=`cat train_list.txt | wc -l`
copy_num=`echo $[25*10*$total_batch_size/$train_list_length]`
if [[ $copy_num -gt 1 ]];then
rm -rf train_list.txt
for ((i=1; i <=$copy_num; i++));do
cat val_list.txt >> train_list.txt
done
fi
cd ../../
fi
if [[ ${#gpu_id} -le 1 ]];then
log_path="$SAVE_LOG/profiling_log"
mkdir -p $log_path
......
......@@ -50,5 +50,11 @@ inference:python/predict_rec.py -c configs/inference_rec.yaml
-o Global.benchmark:False
null:null
null:null
===========================train_benchmark_params==========================
batch_size:256
fp_items:fp32|fp16
epoch:1
--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile
flags:FLAGS_eager_delete_tensor_gb=0.0;FLAGS_fraction_of_gpu_memory_to_use=0.98;FLAGS_conv_workspace_size_limit=4096
===========================infer_benchmark_params==========================
random_infer_input:[{float32,[3,224,224]}]
\ No newline at end of file
......@@ -346,12 +346,27 @@ fi
if [[ ${MODE} = "benchmark_train" ]]; then
pip install -r requirements.txt
cd dataset
rm -rf ILSVRC2012
wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/data/ImageNet1k/ILSVRC2012_val.tar
tar xf ILSVRC2012_val.tar
ln -s ILSVRC2012_val ILSVRC2012
cd ILSVRC2012
rm -rf train_list.txt
ln -s val_list.txt train_list.txt
if [[ $model_name == *GeneralRecognition* ]]; then
rm -rf Aliproduct
rm -rf train_reg_all_data.txt
rm -rf demo_train
wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/data/whole_chain/tipc_shitu_demo_data.tar --no-check-certificate
tar -xf tipc_shitu_demo_data.tar
ln -s tipc_shitu_demo_data Aliproduct
ln -s tipc_shitu_demo_data/demo_train.txt train_reg_all_data.txt
ln -s tipc_shitu_demo_data/demo_train demo_train
cd tipc_shitu_demo_data
ln -s demo_test.txt val_list.txt
else
rm -rf ILSVRC2012
wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/data/ImageNet1k/ILSVRC2012_val.tar
tar xf ILSVRC2012_val.tar
ln -s ILSVRC2012_val ILSVRC2012
cd ILSVRC2012
rm -rf train_list.txt
ln -s val_list.txt train_list.txt
fi
cd ../../
fi
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册