Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleGAN
提交
79b2287d
P
PaddleGAN
项目概览
PaddlePaddle
/
PaddleGAN
大约 1 年 前同步成功
通知
97
Star
7254
Fork
1210
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleGAN
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
79b2287d
编写于
11月 05, 2021
作者:
L
lzzyzlbb
提交者:
GitHub
11月 05, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add profile (#463)
* fix benchmark * Add profile
上级
bc27b744
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
4 deletion
+21
-4
benchmark/README.md
benchmark/README.md
+7
-0
benchmark/run_all.sh
benchmark/run_all.sh
+4
-3
benchmark/run_benchmark.sh
benchmark/run_benchmark.sh
+10
-1
未找到文件。
benchmark/README.md
浏览文件 @
79b2287d
...
...
@@ -42,6 +42,13 @@ nvidia-docker run --name test_paddlegan -i \
${ImageName} /bin/bash -c "${run_cmd}"
```
如果需要打开profile选项,可以直接替换
`run_cmd`
为:
```
run_cmd="set -xe;
cd /workspace ;
bash -x benchmark/run_all.sh on"
```
## 输出
执行完成后,在PaddleGAN目录会产出模型训练性能数据的文件,比如
`esrgan_mp_bs32_fp32_8`
等文件。
benchmark/run_all.sh
浏览文件 @
79b2287d
...
...
@@ -53,6 +53,7 @@ function parse_yaml {
}
eval
$(
parse_yaml
"benchmark/benchmark.yaml"
)
profile
=
${
1
:-
"off"
}
for
model_mode
in
${
model_mode_list
[@]
}
;
do
eval
fp_item_list
=
'$'
"
${
model_mode
}
_fp_item"
...
...
@@ -82,15 +83,15 @@ for model_mode in ${model_mode_list[@]}; do
do
echo
"index is speed, 1gpus, begin,
${
model_name
}
"
run_mode
=
sp
CUDA_VISIBLE_DEVICES
=
0 benchmark/run_benchmark.sh
${
run_mode
}
${
bs_item
}
${
fp_item
}
${
mode
}
${
max_iter
}
${
model_mode
}
${
config
}
${
log_interval
}
# (5min)
CUDA_VISIBLE_DEVICES
=
0 benchmark/run_benchmark.sh
${
run_mode
}
${
bs_item
}
${
fp_item
}
${
mode
}
${
max_iter
}
${
model_mode
}
${
config
}
${
log_interval
}
${
profile
}
# (5min)
sleep
60
echo
"index is speed, 8gpus, run_mode is multi_process, begin,
${
model_name
}
"
run_mode
=
mp
basicvsr_name
=
basicvsr
if
[
${
model_mode
}
=
${
basicvsr_name
}
]
;
then
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
}
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
}
else
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
}
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
}
fi
sleep
60
done
...
...
benchmark/run_benchmark.sh
浏览文件 @
79b2287d
...
...
@@ -12,6 +12,7 @@ function _set_params(){
config
=
${
7
:-
"config"
}
log_interval
=
${
8
:-
"1"
}
run_log_path
=
${
TRAIN_LOG_DIR
:-
$(
pwd
)
}
# TRAIN_LOG_DIR 后续QA设置该参数
need_profile
=
${
9
:-
"off"
}
# 以下不用修改
device
=
${
CUDA_VISIBLE_DEVICES
//,/
}
...
...
@@ -19,6 +20,7 @@ function _set_params(){
num_gpu_devices
=
${#
arr
[*]
}
log_file
=
${
run_log_path
}
/
${
model_name
}
_
${
run_mode
}
_bs
${
batch_size
}
_
${
fp_item
}
_
${
num_gpu_devices
}
res_log_file
=
${
run_log_path
}
/
${
model_name
}
_
${
run_mode
}
_bs
${
batch_size
}
_
${
fp_item
}
_
${
num_gpu_devices
}
_speed
log_profile
=
${
run_log_path
}
/
${
model_name
}
_model.profile
}
function
_analysis_log
(){
...
...
@@ -29,7 +31,14 @@ function _train(){
echo
"Train on
${
num_gpu_devices
}
GPUs"
echo
"current CUDA_VISIBLE_DEVICES=
$CUDA_VISIBLE_DEVICES
, gpus=
$num_gpu_devices
, batch_size=
$batch_size
"
train_cmd
=
"--config-file=
${
config
}
profiler_cmd
=
""
profiler_options
=
"batch_range=[10,20];profile_path=
${
log_profile
}
"
if
[
$need_profile
=
"on"
]
;
then
profiler_cmd
=
"--profiler_options=
${
profiler_options
}
"
fi
train_cmd
=
"
${
profiler_cmd
}
--config-file=
${
config
}
-o dataset.train.batch_size=
${
batch_size
}
log_config.interval=
${
log_interval
}
${
mode
}
=
${
max_iter
}
"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录