Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
9419de52
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9419de52
编写于
3月 15, 2019
作者:
D
dongdaxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add IO percent for multi_trainer
上级
a58df687
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
12 deletion
+19
-12
paddle/fluid/framework/downpour_worker.cc
paddle/fluid/framework/downpour_worker.cc
+6
-1
paddle/fluid/framework/hogwild_worker.cc
paddle/fluid/framework/hogwild_worker.cc
+1
-6
python/paddle/fluid/executor.py
python/paddle/fluid/executor.py
+12
-5
未找到文件。
paddle/fluid/framework/downpour_worker.cc
浏览文件 @
9419de52
...
...
@@ -211,13 +211,16 @@ void DownpourWorker::TrainFilesWithProfiler() {
&
feature_values_
[
tid
],
table
.
fea_dim
());
timeline
.
Pause
();
pull_sparse_time
+=
timeline
.
ElapsedSec
();
total_time
+=
timeline
.
ElapsedSec
();
CollectLabelInfo
(
i
);
timeline
.
Pause
();
collect_label_time
+=
timeline
.
ElapsedSec
();
total_time
+=
timeline
.
ElapsedSec
();
timeline
.
Start
();
FillSparseValue
(
i
);
timeline
.
Pause
();
fill_sparse_time
+=
timeline
.
ElapsedSec
();
total_time
+=
timeline
.
ElapsedSec
();
}
VLOG
(
3
)
<<
"Fill sparse value for all sparse table done."
;
...
...
@@ -257,6 +260,7 @@ void DownpourWorker::TrainFilesWithProfiler() {
&
feature_grads_
[
tid
],
&
push_sparse_status_
);
timeline
.
Pause
();
push_sparse_time
+=
timeline
.
ElapsedSec
();
total_time
+=
timeline
.
ElapsedSec
();
}
timeline
.
Start
();
...
...
@@ -269,7 +273,7 @@ void DownpourWorker::TrainFilesWithProfiler() {
}
timeline
.
Pause
();
push_dense_time
+=
timeline
.
ElapsedSec
();
total_time
+=
timeline
.
ElapsedSec
();
VLOG
(
3
)
<<
"push sparse and dense gradient done."
;
int32_t
tmp_push_dense_wait_times
=
-
1
;
int32_t
tmp_push_sparse_wait_times
=
-
1
;
...
...
@@ -324,6 +328,7 @@ void DownpourWorker::TrainFilesWithProfiler() {
fprintf
(
stderr
,
"IO percent: %f
\n
"
,
read_time
/
total_time
*
100
);
}
}
timeline
.
Start
();
}
}
...
...
paddle/fluid/framework/hogwild_worker.cc
浏览文件 @
9419de52
...
...
@@ -110,12 +110,7 @@ void HogwildWorker::TrainFilesWithProfiler() {
op_name
[
i
].
c_str
(),
op_total_time
[
i
]
/
batch_cnt
);
}
fprintf
(
stderr
,
"mean read time: %fs
\n
"
,
read_time
/
batch_cnt
);
/*
int fetch_var_num = fetch_var_names_.size();
for (int i = 0; i < fetch_var_num; ++i) {
print_fetch_var(thread_scope_, fetch_var_names_[i]);
}
*/
fprintf
(
stderr
,
"IO percent: %f
\n
"
,
read_time
/
total_time
*
100
);
}
}
timeline
.
Start
();
...
...
python/paddle/fluid/executor.py
浏览文件 @
9419de52
...
...
@@ -636,21 +636,28 @@ class Executor(object):
if
not
compiled
:
trainer
=
TrainerFactory
().
create_trainer
(
program
.
_fleet_opt
)
trainer
.
set_program
(
program
)
with
open
(
"fleet_desc.prototxt"
,
"w"
)
as
fout
:
fout
.
write
(
str
(
program
.
_fleet_opt
[
"fleet_desc"
]))
else
:
trainer
=
TrainerFactory
().
create_trainer
(
program
.
program
.
_fleet_opt
)
trainer
.
set_program
(
program
.
program
)
if
thread
<=
0
:
trainer
.
set_thread
(
dataset
.
thread_num
)
if
dataset
.
thread_num
<=
0
:
raise
RuntimeError
(
"You should set thread num first, either in Dataset or in Executor.train_from_dataset"
)
else
:
trainer
.
set_thread
(
dataset
.
thread_num
)
else
:
trainer
.
set_thread
(
thread
)
trainer
.
set_debug
(
debug
)
trainer
.
gen_trainer_desc
()
dataset
.
_prepare_to_run
()
with
open
(
"trainer_desc.prototxt"
,
"w"
)
as
fout
:
fout
.
write
(
trainer
.
_desc
())
if
debug
:
with
open
(
"train_desc.prototxt"
,
"w"
)
as
fout
:
fout
.
write
(
trainer
.
_desc
())
if
program
.
_fleet_opt
:
with
open
(
"fleet_desc.prototxt"
,
"w"
)
as
fout
:
fout
.
write
(
str
(
program
.
_fleet_opt
[
"fleet_desc"
]))
self
.
_default_executor
.
run_from_dataset
(
program
.
desc
,
scope
,
dataset
.
dataset
,
trainer
.
_desc
())
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录