提交 2cf1dd7e 编写于 作者: M mmglove 提交者: cuicheng01

add PROFILING_TIMER_ONLY

上级 dd9b186e
...@@ -115,6 +115,8 @@ repo_name=$(get_repo_name ) ...@@ -115,6 +115,8 @@ repo_name=$(get_repo_name )
SAVE_LOG=${BENCHMARK_LOG_DIR:-$(pwd)} # */benchmark_log SAVE_LOG=${BENCHMARK_LOG_DIR:-$(pwd)} # */benchmark_log
mkdir -p "${SAVE_LOG}/benchmark_log/" mkdir -p "${SAVE_LOG}/benchmark_log/"
status_log="${SAVE_LOG}/benchmark_log/results.log" status_log="${SAVE_LOG}/benchmark_log/results.log"
# get benchmark profiling params : PROFILING_TIMER_ONLY=no|True|False
PROFILING_TIMER_ONLY=${PROFILING_TIMER_ONLY:-"no"}
# The number of lines in which train params can be replaced. # The number of lines in which train params can be replaced.
line_python=3 line_python=3
...@@ -204,19 +206,26 @@ for batch_size in ${batch_size_list[*]}; do ...@@ -204,19 +206,26 @@ for batch_size in ${batch_size_list[*]}; do
gpu_id=$(set_gpu_id $device_num) gpu_id=$(set_gpu_id $device_num)
if [[ ${#gpu_id} -le 1 ]];then if [[ ${#gpu_id} -le 1 ]];then
log_path="$SAVE_LOG/profiling_log"
mkdir -p $log_path
log_name="${repo_name}_${model_name}_bs${batch_size}_${precision}_${run_mode}_${device_num}_${to_static}profiling"
func_sed_params "$FILENAME" "${line_gpuid}" "0" # sed used gpu_id func_sed_params "$FILENAME" "${line_gpuid}" "0" # sed used gpu_id
# set profile_option params if [[ ${PROFILING_TIMER_ONLY} != "no" ]];then
tmp=`sed -i "${line_profile}s/.*/${profile_option}/" "${FILENAME}"` echo "run profile"
# The default value of profile_option's timer_only parameter is True
# run test_train_inference_python.sh if [[ ${PROFILING_TIMER_ONLY} = "False" ]];then
cmd="timeout 5m bash test_tipc/test_train_inference_python.sh ${FILENAME} benchmark_train > ${log_path}/${log_name} 2>&1 " profile_option="${profile_option};timer_only=False"
echo $cmd fi
eval ${cmd} log_path="$SAVE_LOG/profiling_log"
eval "cat ${log_path}/${log_name}" mkdir -p $log_path
log_name="${repo_name}_${model_name}_bs${batch_size}_${precision}_${run_mode}_${device_num}_${to_static}profiling"
# set profile_option params
tmp=`sed -i "${line_profile}s/.*/\"${profile_option}\"/" "${FILENAME}"`
# run test_train_inference_python.sh
cmd="timeout 5m bash test_tipc/test_train_inference_python.sh ${FILENAME} benchmark_train > ${log_path}/${log_name} 2>&1 "
echo $cmd
eval ${cmd}
eval "cat ${log_path}/${log_name}"
fi
echo "run without profile"
# without profile # without profile
log_path="$SAVE_LOG/train_log" log_path="$SAVE_LOG/train_log"
speed_log_path="$SAVE_LOG/index" speed_log_path="$SAVE_LOG/index"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册