Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
51c01cfe
P
PaddleClas
项目概览
PaddlePaddle
/
PaddleClas
1 年多 前同步成功
通知
115
Star
4999
Fork
1114
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
6
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleClas
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
6
合并请求
6
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
51c01cfe
编写于
3月 15, 2022
作者:
W
Wei Shengyu
提交者:
GitHub
3月 15, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1756 from Aurelius84/dy2stat_benchmark
[TIPC-Benchmark]Support @to_static traing for Benchmark
上级
e7cb66bb
6eaed4f0
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
33 addition
and
15 deletion
+33
-15
test_tipc/benchmark_train.sh
test_tipc/benchmark_train.sh
+21
-6
test_tipc/config/MobileNetV1/MobileNetV1_train_infer_python.txt
...ipc/config/MobileNetV1/MobileNetV1_train_infer_python.txt
+1
-1
test_tipc/config/MobileNetV2/MobileNetV2_train_infer_python.txt
...ipc/config/MobileNetV2/MobileNetV2_train_infer_python.txt
+1
-1
test_tipc/config/ResNet/ResNet152_train_infer_python.txt
test_tipc/config/ResNet/ResNet152_train_infer_python.txt
+1
-1
test_tipc/config/ResNet/ResNet50_train_infer_python.txt
test_tipc/config/ResNet/ResNet50_train_infer_python.txt
+1
-1
test_tipc/test_train_inference_python.sh
test_tipc/test_train_inference_python.sh
+8
-5
未找到文件。
test_tipc/benchmark_train.sh
浏览文件 @
51c01cfe
...
...
@@ -65,7 +65,22 @@ FILENAME=$new_filename
# MODE must be one of ['benchmark_train']
MODE
=
$2
PARAMS
=
$3
# bash test_tipc/benchmark_train.sh test_tipc/configs/det_mv3_db_v2_0/train_benchmark.txt benchmark_train dynamic_bs8_null_DP_N1C1
REST_ARGS
=
$4
# bash test_tipc/benchmark_train.sh test_tipc/configs/det_mv3_db_v2_0/train_benchmark.txt benchmark_train
# bash test_tipc/benchmark_train.sh test_tipc/configs/det_mv3_db_v2_0/train_benchmark.txt benchmark_train to_static
# bash test_tipc/benchmark_train.sh test_tipc/configs/det_mv3_db_v2_0/train_benchmark.txt benchmark_train dynamic_bs8_null_DP_N1C1 to_static
to_static
=
"d2sF"
# parse "to_static" options and modify trainer into "to_static_trainer"
if
[
$REST_ARGS
=
"to_static"
]
||
[
$PARAMS
=
"to_static"
]
;
then
to_static
=
"d2sT"
sed
-i
's/trainer:norm_train/trainer:to_static_train/g'
$FILENAME
# clear PARAM contents
if
[
$PARAMS
=
"to_static"
]
;
then
PARAMS
=
""
fi
fi
IFS
=
$'
\n
'
# parser params from train_benchmark.txt
sed
-i
's/ -o DataLoader.Train.sampler.shuffle=False//g'
$FILENAME
...
...
@@ -168,7 +183,7 @@ for batch_size in ${batch_size_list[*]}; do
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
}
_profiling"
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
# set profile_option params
tmp
=
`
sed
-i
"
${
line_profile
}
s/.*/
${
profile_option
}
/"
"
${
FILENAME
}
"
`
...
...
@@ -184,8 +199,8 @@ for batch_size in ${batch_size_list[*]}; do
speed_log_path
=
"
$SAVE_LOG
/index"
mkdir
-p
$log_path
mkdir
-p
$speed_log_path
log_name
=
"
${
repo_name
}
_
${
model_name
}
_bs
${
batch_size
}
_
${
precision
}
_
${
run_mode
}
_
${
device_num
}
_log"
speed_log_name
=
"
${
repo_name
}
_
${
model_name
}
_bs
${
batch_size
}
_
${
precision
}
_
${
run_mode
}
_
${
device_num
}
_speed"
log_name
=
"
${
repo_name
}
_
${
model_name
}
_bs
${
batch_size
}
_
${
precision
}
_
${
run_mode
}
_
${
device_num
}
_
${
to_static
}
_
log"
speed_log_name
=
"
${
repo_name
}
_
${
model_name
}
_bs
${
batch_size
}
_
${
precision
}
_
${
run_mode
}
_
${
device_num
}
_
${
to_static
}
_
speed"
func_sed_params
"
$FILENAME
"
"
${
line_profile
}
"
"null"
# sed profile_id as null
cmd
=
"bash test_tipc/test_train_inference_python.sh
${
FILENAME
}
benchmark_train >
${
log_path
}
/
${
log_name
}
2>&1 "
echo
$cmd
...
...
@@ -219,8 +234,8 @@ for batch_size in ${batch_size_list[*]}; do
speed_log_path
=
"
$SAVE_LOG
/index"
mkdir
-p
$log_path
mkdir
-p
$speed_log_path
log_name
=
"
${
repo_name
}
_
${
model_name
}
_bs
${
batch_size
}
_
${
precision
}
_
${
run_mode
}
_
${
device_num
}
_log"
speed_log_name
=
"
${
repo_name
}
_
${
model_name
}
_bs
${
batch_size
}
_
${
precision
}
_
${
run_mode
}
_
${
device_num
}
_speed"
log_name
=
"
${
repo_name
}
_
${
model_name
}
_bs
${
batch_size
}
_
${
precision
}
_
${
run_mode
}
_
${
device_num
}
_
${
to_static
}
_
log"
speed_log_name
=
"
${
repo_name
}
_
${
model_name
}
_bs
${
batch_size
}
_
${
precision
}
_
${
run_mode
}
_
${
device_num
}
_
${
to_static
}
_
speed"
func_sed_params
"
$FILENAME
"
"
${
line_gpuid
}
"
"
$gpu_id
"
# sed used gpu_id
func_sed_params
"
$FILENAME
"
"
${
line_profile
}
"
"null"
# sed --profile_option as null
cmd
=
"bash test_tipc/test_train_inference_python.sh
${
FILENAME
}
benchmark_train >
${
log_path
}
/
${
log_name
}
2>&1 "
...
...
test_tipc/config/MobileNetV1/MobileNetV1_train_infer_python.txt
浏览文件 @
51c01cfe
...
...
@@ -17,7 +17,7 @@ norm_train:tools/train.py -c ppcls/configs/ImageNet/MobileNetV1/MobileNetV1.yaml
pact_train:null
fpgm_train:null
distill_train:null
null:null
to_static_train:-o Global.to_static=True
null:null
##
===========================eval_params===========================
...
...
test_tipc/config/MobileNetV2/MobileNetV2_train_infer_python.txt
浏览文件 @
51c01cfe
...
...
@@ -17,7 +17,7 @@ norm_train:tools/train.py -c ppcls/configs/ImageNet/MobileNetV2/MobileNetV2.yaml
pact_train:null
fpgm_train:null
distill_train:null
null:null
to_static_train:-o Global.to_static=True
null:null
##
===========================eval_params===========================
...
...
test_tipc/config/ResNet/ResNet152_train_infer_python.txt
浏览文件 @
51c01cfe
...
...
@@ -17,7 +17,7 @@ norm_train:tools/train.py -c ppcls/configs/ImageNet/ResNet/ResNet152.yaml -o Glo
pact_train:null
fpgm_train:null
distill_train:null
null:null
to_static_train:-o Global.to_static=True
null:null
##
===========================eval_params===========================
...
...
test_tipc/config/ResNet/ResNet50_train_infer_python.txt
浏览文件 @
51c01cfe
...
...
@@ -17,7 +17,7 @@ norm_train:tools/train.py -c ppcls/configs/ImageNet/ResNet/ResNet50.yaml -o Glob
pact_train:null
fpgm_train:null
distill_train:null
null:null
to_static_train:-o Global.to_static=True
null:null
##
===========================eval_params===========================
...
...
test_tipc/test_train_inference_python.sh
浏览文件 @
51c01cfe
...
...
@@ -40,8 +40,8 @@ fpgm_key=$(func_parser_key "${lines[17]}")
fpgm_trainer
=
$(
func_parser_value
"
${
lines
[17]
}
"
)
distill_key
=
$(
func_parser_key
"
${
lines
[18]
}
"
)
distill_trainer
=
$(
func_parser_value
"
${
lines
[18]
}
"
)
t
rainer_key1
=
$(
func_parser_key
"
${
lines
[19]
}
"
)
t
rainer_value1
=
$(
func_parser_value
"
${
lines
[19]
}
"
)
t
o_static_key
=
$(
func_parser_key
"
${
lines
[19]
}
"
)
t
o_static_trainer
=
$(
func_parser_value
"
${
lines
[19]
}
"
)
trainer_key2
=
$(
func_parser_key
"
${
lines
[20]
}
"
)
trainer_value2
=
$(
func_parser_value
"
${
lines
[20]
}
"
)
...
...
@@ -246,9 +246,12 @@ else
elif
[
${
trainer
}
=
"
${
distill_key
}
"
]
;
then
run_train
=
${
distill_trainer
}
run_export
=
${
distill_export
}
elif
[
${
trainer
}
=
${
trainer_key1
}
]
;
then
run_train
=
${
trainer_value1
}
run_export
=
${
export_value1
}
# In case of @to_static, we re-used norm_traier,
# but append "-o Global.to_static=True" for config
# to trigger "apply_to_static" logic in 'engine.py'
elif
[
${
trainer
}
=
"
${
to_static_key
}
"
]
;
then
run_train
=
"
${
norm_trainer
}
${
to_static_trainer
}
"
run_export
=
${
norm_export
}
elif
[[
${
trainer
}
=
${
trainer_key2
}
]]
;
then
run_train
=
${
trainer_value2
}
run_export
=
${
export_value2
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录