Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
892c0e67
Commit
892c0e67
authored
Jan 25, 2022
by
LDOUBLEV
Browse files
add benchmark params to train_benchmark.txt
parent
a530b698
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
0 deletions
+93
-0
test_tipc/benchmark_train.sh
test_tipc/benchmark_train.sh
+83
-0
test_tipc/configs/det_mv3_db_v2.0/train_benchmark.txt
test_tipc/configs/det_mv3_db_v2.0/train_benchmark.txt
+10
-0
No files found.
test_tipc/benchmark_train.sh
0 → 100644
View file @
892c0e67
#!/bin/bash
source
test_tipc/common_func.sh
# run benchmark sh
# params: batch
# Usage:
# bash run_benchmark_train.sh config.txt benchmark_train batch_size=2 precision=3 profile_option=4
function
func_parser_params
(){
strs
=
$1
IFS
=
"="
array
=(
${
strs
}
)
tmp
=
${
array
[1]
}
echo
${
tmp
}
}
function
func_sed_params
(){
filename
=
$1
line
=
$2
param_value
=
$3
# cmd="sed -n '${line}p' $filename"
# params=`eval $cmd`
params
=
`
sed
-n
"
${
line
}
p"
$filename
`
# params=`cmd`
#params=$($cmd)
IFS
=
":"
array
=(
${
params
}
)
key
=
${
array
[0]
}
value
=
${
array
[1]
}
if
[[
$value
=
~
'benchmark_train'
]]
;
then
IFS
=
'='
_val
=(
${
value
}
)
param_value
=
"
${
_val
[0]
}
=
${
param_value
}
"
fi
new_params
=
"
${
key
}
:
${
param_value
}
"
IFS
=
";"
cmd
=
"sed -i '
${
line
}
s/.*/
${
new_params
}
/' '
${
filename
}
'"
# echo $cmd
eval
$cmd
}
function
set_gpu_id
(){
string
=
$1
_str
=
${
string
:1:6
}
arr
=(
${
_str
}
)
P
=
${
arr
[1]
}
gpu_num
=
`
expr
$P
- 1
`
seq
=
`
seq
-s
","
0
$gpu_num
`
echo
$seq
}
FILENAME
=
$1
# MODE be one of ['benchmark_train']
MODE
=
$2
#
# line_bs=9
# line_presion=6
# line_profile=13
# if [ $# -eq 4 ] ; then
# echo "Usage: bash run_benchmark_train.sh config.txt benchmark_train batch_size=2 precision=fp16"
# elif [ $# -eq 5 ] ; then
# echo "Usage: bash run_benchmark_train.sh config.txt benchmark_train batch_size=2 precision=fp16 profile_option=None"
# profile_options=$(func_parser_params "$5")
# else
# echo "None"
# fi
# l=`grep -n "benchmark_params" ${FILENAME} | cut -d ":" -f 1`
# echo $l
# sed -i '[第n行]s/[正则通配符]/[替换内容]/' [指定文件]
test_tipc/configs/det_mv3_db_v2.0/train_benchmark.txt
View file @
892c0e67
...
...
@@ -28,3 +28,13 @@ null:null
Global.save_inference_dir:./output/
Global.checkpoints:
norm_export:null
===========================benchmark_params==========================
device_num:N1C1|N1C8|N4C32
run_process_type:MultiP
run_mode:DP|DP1-MP1-PP1|DP2-MP2-PP2
ips_unit:"images/s"
skip_steps:10
keyword:"ips:"
convergence_key:"loss:"
flags:FLAGS_eager_delete_tensor_gb=0.0;FLAGS_fraction_of_gpu_memory_to_use=0.98;FLAGS_conv_workspace_size_limit=4096
null:null
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment