Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
5c7a5233
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5c7a5233
编写于
3月 26, 2018
作者:
Y
Yu Yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add Graphviz output
上级
edfd741e
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
91 addition
and
1 deletion
+91
-1
paddle/fluid/framework/details/computation_op_handle.cc
paddle/fluid/framework/details/computation_op_handle.cc
+2
-0
paddle/fluid/framework/details/computation_op_handle.h
paddle/fluid/framework/details/computation_op_handle.h
+2
-0
paddle/fluid/framework/details/fetch_op_handle.cc
paddle/fluid/framework/details/fetch_op_handle.cc
+2
-0
paddle/fluid/framework/details/fetch_op_handle.h
paddle/fluid/framework/details/fetch_op_handle.h
+2
-0
paddle/fluid/framework/details/multi_devices_graph_builder.cc
...le/fluid/framework/details/multi_devices_graph_builder.cc
+6
-0
paddle/fluid/framework/details/nccl_all_reduce_op_handle.cc
paddle/fluid/framework/details/nccl_all_reduce_op_handle.cc
+2
-0
paddle/fluid/framework/details/nccl_all_reduce_op_handle.h
paddle/fluid/framework/details/nccl_all_reduce_op_handle.h
+2
-0
paddle/fluid/framework/details/op_handle_base.h
paddle/fluid/framework/details/op_handle_base.h
+2
-0
paddle/fluid/framework/details/scale_loss_grad_op_handle.cc
paddle/fluid/framework/details/scale_loss_grad_op_handle.cc
+2
-0
paddle/fluid/framework/details/scale_loss_grad_op_handle.h
paddle/fluid/framework/details/scale_loss_grad_op_handle.h
+2
-0
paddle/fluid/framework/details/ssa_graph_builder.cc
paddle/fluid/framework/details/ssa_graph_builder.cc
+58
-0
paddle/fluid/framework/details/ssa_graph_builder.h
paddle/fluid/framework/details/ssa_graph_builder.h
+2
-0
paddle/fluid/framework/details/threaded_ssa_graph_executor.cc
...le/fluid/framework/details/threaded_ssa_graph_executor.cc
+6
-0
python/paddle/fluid/tests/unittests/test_parallel_executor.py
...on/paddle/fluid/tests/unittests/test_parallel_executor.py
+1
-1
未找到文件。
paddle/fluid/framework/details/computation_op_handle.cc
浏览文件 @
5c7a5233
...
...
@@ -35,6 +35,8 @@ void ComputationOpHandle::RunImpl() {
op_
->
Run
(
*
scope_
,
place_
);
}
std
::
string
ComputationOpHandle
::
Name
()
const
{
return
op_
->
Type
();
}
}
// namespace details
}
// namespace framework
}
// namespace paddle
paddle/fluid/framework/details/computation_op_handle.h
浏览文件 @
5c7a5233
...
...
@@ -31,6 +31,8 @@ struct ComputationOpHandle : public OpHandleBase {
ComputationOpHandle
(
const
OpDesc
&
op_desc
,
Scope
*
scope
,
platform
::
Place
place
);
std
::
string
Name
()
const
override
;
protected:
void
RunImpl
()
override
;
};
...
...
paddle/fluid/framework/details/fetch_op_handle.cc
浏览文件 @
5c7a5233
...
...
@@ -72,6 +72,8 @@ void FetchOpHandle::RunImpl() {
}
}
std
::
string
FetchOpHandle
::
Name
()
const
{
return
"Fetch"
;
}
}
// namespace details
}
// namespace framework
}
// namespace paddle
paddle/fluid/framework/details/fetch_op_handle.h
浏览文件 @
5c7a5233
...
...
@@ -38,6 +38,8 @@ struct FetchOpHandle : public OpHandleBase {
void
WaitAndMergeCPUTensors
()
const
;
std
::
string
Name
()
const
override
;
protected:
void
RunImpl
()
override
;
};
...
...
paddle/fluid/framework/details/multi_devices_graph_builder.cc
浏览文件 @
5c7a5233
...
...
@@ -136,6 +136,12 @@ std::unique_ptr<SSAGraph> MultiDevSSAGraphBuilder::Build(
*/
PolishGraphToSupportDataHazards
(
&
result
);
if
(
VLOG_IS_ON
(
10
))
{
std
::
ostringstream
sout
;
PrintGraphviz
(
*
graph
,
sout
);
VLOG
(
10
)
<<
sout
.
str
();
}
return
std
::
unique_ptr
<
SSAGraph
>
(
graph
);
}
}
// namespace details
...
...
paddle/fluid/framework/details/nccl_all_reduce_op_handle.cc
浏览文件 @
5c7a5233
...
...
@@ -69,6 +69,8 @@ void NCCLAllReduceOpHandle::RunImpl() {
}
}
}
std
::
string
NCCLAllReduceOpHandle
::
Name
()
const
{
return
"NCCL AllReduce"
;
}
}
// namespace details
}
// namespace framework
}
// namespace paddle
paddle/fluid/framework/details/nccl_all_reduce_op_handle.h
浏览文件 @
5c7a5233
...
...
@@ -32,6 +32,8 @@ struct NCCLAllReduceOpHandle : public OpHandleBase {
const
std
::
vector
<
platform
::
Place
>
&
places
,
const
platform
::
NCCLContextMap
&
ctxs
);
std
::
string
Name
()
const
override
;
protected:
void
RunImpl
()
override
;
};
...
...
paddle/fluid/framework/details/op_handle_base.h
浏览文件 @
5c7a5233
...
...
@@ -33,6 +33,8 @@ struct OpHandleBase {
std
::
string
DebugString
()
const
;
virtual
std
::
string
Name
()
const
=
0
;
virtual
~
OpHandleBase
();
void
Run
(
bool
use_event
);
...
...
paddle/fluid/framework/details/scale_loss_grad_op_handle.cc
浏览文件 @
5c7a5233
...
...
@@ -45,6 +45,8 @@ void ScaleLossGradOpHandle::RunImpl() {
#endif
}
}
std
::
string
ScaleLossGradOpHandle
::
Name
()
const
{
return
"Scale LossGrad"
;
}
}
// namespace details
}
// namespace framework
}
// namespace paddle
paddle/fluid/framework/details/scale_loss_grad_op_handle.h
浏览文件 @
5c7a5233
...
...
@@ -32,6 +32,8 @@ struct ScaleLossGradOpHandle : public OpHandleBase {
~
ScaleLossGradOpHandle
()
final
;
std
::
string
Name
()
const
override
;
protected:
void
RunImpl
()
override
;
};
...
...
paddle/fluid/framework/details/ssa_graph_builder.cc
浏览文件 @
5c7a5233
...
...
@@ -83,6 +83,64 @@ void SSAGraphBuilder::CreateOpOutput(SSAGraph *graph, OpHandleBase *op_handle,
var
.
place_
=
place
;
op_handle
->
AddOutput
(
&
var
);
}
template
<
typename
Callback
>
void
IterAllVar
(
const
SSAGraph
&
graph
,
Callback
callback
)
{
for
(
auto
&
each
:
graph
.
vars_
)
{
for
(
auto
&
pair1
:
each
)
{
for
(
auto
&
pair2
:
pair1
.
second
)
{
callback
(
pair2
.
second
);
}
}
}
for
(
auto
&
var
:
graph
.
dep_vars_
)
{
callback
(
*
var
);
}
}
void
SSAGraphBuilder
::
PrintGraphviz
(
const
SSAGraph
&
graph
,
std
::
ostream
&
sout
)
{
size_t
var_id
=
0
;
std
::
unordered_map
<
const
VarHandleBase
*
,
size_t
>
vars
;
sout
<<
"digraph G {
\n
"
;
IterAllVar
(
graph
,
[
&
](
const
VarHandleBase
&
var
)
{
auto
*
var_ptr
=
&
var
;
auto
*
var_handle_ptr
=
dynamic_cast
<
const
VarHandle
*>
(
var_ptr
);
auto
*
dummy_ptr
=
dynamic_cast
<
const
DummyVarHandle
*>
(
var_ptr
);
size_t
cur_var_id
=
var_id
++
;
vars
[
var_ptr
]
=
cur_var_id
;
if
(
var_handle_ptr
)
{
sout
<<
"var_"
<<
cur_var_id
<<
" [label=
\"
"
<<
var_handle_ptr
->
name_
<<
"
\\
n"
<<
var_handle_ptr
->
place_
<<
"
\\
n"
<<
var_handle_ptr
->
version_
<<
"
\"
]"
<<
std
::
endl
;
}
else
if
(
dummy_ptr
)
{
sout
<<
"var_"
<<
cur_var_id
<<
" [label=
\"
dummy
\"
]"
<<
std
::
endl
;
}
});
size_t
op_id
=
0
;
for
(
auto
&
op
:
graph
.
ops_
)
{
std
::
string
op_name
=
"op_"
+
std
::
to_string
(
op_id
++
);
sout
<<
op_name
<<
" [label=
\"
"
<<
op
->
Name
()
<<
"
\"
, shape=rect]"
<<
std
::
endl
;
for
(
auto
in
:
op
->
inputs_
)
{
std
::
string
var_name
=
"var_"
+
std
::
to_string
(
vars
[
in
]);
sout
<<
var_name
<<
" -> "
<<
op_name
<<
std
::
endl
;
}
for
(
auto
out
:
op
->
outputs_
)
{
std
::
string
var_name
=
"var_"
+
std
::
to_string
(
vars
[
out
]);
sout
<<
op_name
<<
" -> "
<<
var_name
<<
std
::
endl
;
}
}
sout
<<
"}
\n
"
;
}
}
// namespace details
}
// namespace framework
}
// namespace paddle
paddle/fluid/framework/details/ssa_graph_builder.h
浏览文件 @
5c7a5233
...
...
@@ -51,6 +51,8 @@ class SSAGraphBuilder {
static
void
CreateOpOutput
(
SSAGraph
*
graph
,
OpHandleBase
*
op_handle
,
const
std
::
string
&
each_var_name
,
const
platform
::
Place
&
place
,
size_t
place_offset
);
static
void
PrintGraphviz
(
const
SSAGraph
&
graph
,
std
::
ostream
&
sout
);
};
}
// namespace details
}
// namespace framework
...
...
paddle/fluid/framework/details/threaded_ssa_graph_executor.cc
浏览文件 @
5c7a5233
...
...
@@ -133,6 +133,12 @@ FeedFetchList ThreadedSSAGraphExecutor::Run(
if
(
exception_
)
{
throw
*
exception_
;
}
VLOG
(
10
)
<<
"============================="
;
for
(
auto
&
op
:
pending_ops
)
{
VLOG
(
10
)
<<
op
.
first
->
DebugString
();
}
// keep waiting the ready variables
continue
;
}
...
...
python/paddle/fluid/tests/unittests/test_parallel_executor.py
浏览文件 @
5c7a5233
...
...
@@ -48,7 +48,7 @@ def fc_with_batchnorm():
dtypes
=
[
'float32'
,
'int64'
])
img
,
label
=
fluid
.
layers
.
read_file
(
reader
)
hidden
=
img
for
_
in
xrange
(
4
):
for
_
in
xrange
(
1
):
hidden
=
fluid
.
layers
.
fc
(
hidden
,
size
=
200
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录