Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
a94a7355
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看板
未验证
提交
a94a7355
编写于
11月 20, 2018
作者:
C
chengduo
提交者:
GitHub
11月 20, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refine the GraphNum check (#14144)
* refine GraphCheck test=develop * fix ci fail test=develop
上级
48be9dc3
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
34 addition
and
10 deletion
+34
-10
paddle/fluid/framework/ir/graph_helper.cc
paddle/fluid/framework/ir/graph_helper.cc
+21
-7
paddle/fluid/framework/parallel_executor.cc
paddle/fluid/framework/parallel_executor.cc
+11
-2
python/paddle/fluid/__init__.py
python/paddle/fluid/__init__.py
+2
-1
未找到文件。
paddle/fluid/framework/ir/graph_helper.cc
浏览文件 @
a94a7355
...
@@ -15,8 +15,15 @@ limitations under the License. */
...
@@ -15,8 +15,15 @@ limitations under the License. */
#include "paddle/fluid/framework/ir/graph_helper.h"
#include "paddle/fluid/framework/ir/graph_helper.h"
#include <algorithm>
#include <algorithm>
#include <deque>
#include <deque>
#include <fstream>
#include <iosfwd>
#include <ostream>
#include <unordered_set>
#include <unordered_set>
DEFINE_string
(
print_sub_graph_dir
,
""
,
"FLAGS_print_sub_graph_dir is used "
"to print the nodes of sub_graphs."
);
namespace
paddle
{
namespace
paddle
{
namespace
framework
{
namespace
framework
{
namespace
ir
{
namespace
ir
{
...
@@ -164,12 +171,15 @@ size_t GraphNum(const Graph &graph) {
...
@@ -164,12 +171,15 @@ size_t GraphNum(const Graph &graph) {
graph_nodes
.
emplace_back
(
g_nodes
);
graph_nodes
.
emplace_back
(
g_nodes
);
}
}
if
(
VLOG_IS_ON
(
100
))
{
if
(
FLAGS_print_sub_graph_dir
.
size
())
{
VLOG
(
100
)
<<
"graph_num: "
<<
graph_nodes
.
size
();
if
(
graph_nodes
.
size
()
>
1
)
{
for
(
auto
&
g_n
:
graph_nodes
)
{
VLOG
(
100
)
<<
"graph_nodes: "
<<
g_n
.
size
();
if
(
g_n
.
size
()
<
10
)
{
std
::
stringstream
out
;
std
::
stringstream
out
;
for
(
auto
&
g_n
:
graph_nodes
)
{
out
<<
"graph_nodes: "
<<
g_n
.
size
()
<<
"
\n
"
;
}
out
<<
"
\n\n
"
;
for
(
auto
&
g_n
:
graph_nodes
)
{
out
<<
"graph_nodes: "
<<
g_n
.
size
();
for
(
auto
&
node
:
g_n
)
{
for
(
auto
&
node
:
g_n
)
{
out
<<
"
\n
Node: "
<<
node
->
Name
()
<<
" in ["
;
out
<<
"
\n
Node: "
<<
node
->
Name
()
<<
" in ["
;
for
(
auto
&
n
:
node
->
inputs
)
{
for
(
auto
&
n
:
node
->
inputs
)
{
...
@@ -181,8 +191,12 @@ size_t GraphNum(const Graph &graph) {
...
@@ -181,8 +191,12 @@ size_t GraphNum(const Graph &graph) {
}
}
out
<<
"]"
;
out
<<
"]"
;
}
}
VLOG
(
100
)
<<
out
.
str
()
;
out
<<
"
\n\n\n
"
;
}
}
std
::
unique_ptr
<
std
::
ostream
>
fout
(
new
std
::
ofstream
(
FLAGS_print_sub_graph_dir
));
PADDLE_ENFORCE
(
fout
->
good
());
*
fout
<<
out
.
str
();
}
}
}
}
...
...
paddle/fluid/framework/parallel_executor.cc
浏览文件 @
a94a7355
...
@@ -171,8 +171,17 @@ ParallelExecutor::ParallelExecutor(
...
@@ -171,8 +171,17 @@ ParallelExecutor::ParallelExecutor(
}
}
// If the loss_var_name is given, the number of graph should be only one.
// If the loss_var_name is given, the number of graph should be only one.
if
(
loss_var_name
.
size
())
{
if
(
loss_var_name
.
size
())
{
PADDLE_ENFORCE_EQ
(
ir
::
GraphNum
(
*
graph
),
1
,
size_t
graph_num
=
ir
::
GraphNum
(
*
graph
);
"The number of graph should be only one"
);
if
(
graph_num
>
1
)
{
LOG
(
WARNING
)
<<
"The number of graph should be only one, "
"but the current graph has "
<<
ir
::
GraphNum
(
*
graph
)
<<
" sub_graphs. If you want to see the nodes of the "
"sub_graphs, you should use 'FLAGS_print_sub_graph_dir' "
"to specify the output dir. NOTES: if you not do training, "
"please don't pass loss_var_name."
;
}
}
}
if
(
exec_strategy
.
type_
==
ExecutionStrategy
::
kDefault
)
{
if
(
exec_strategy
.
type_
==
ExecutionStrategy
::
kDefault
)
{
...
...
python/paddle/fluid/__init__.py
浏览文件 @
a94a7355
...
@@ -116,7 +116,8 @@ def __bootstrap__():
...
@@ -116,7 +116,8 @@ def __bootstrap__():
'use_mkldnn'
,
'use_ngraph'
,
'initial_cpu_memory_in_mb'
,
'use_mkldnn'
,
'use_ngraph'
,
'initial_cpu_memory_in_mb'
,
'init_allocated_mem'
,
'free_idle_memory'
,
'paddle_num_threads'
,
'init_allocated_mem'
,
'free_idle_memory'
,
'paddle_num_threads'
,
"dist_threadpool_size"
,
'cpu_deterministic'
,
'eager_delete_tensor_gb'
,
"dist_threadpool_size"
,
'cpu_deterministic'
,
'eager_delete_tensor_gb'
,
'allocator_strategy'
,
'reader_queue_speed_test_mode'
'allocator_strategy'
,
'reader_queue_speed_test_mode'
,
'print_sub_graph_dir'
]
]
if
os
.
name
!=
'nt'
:
if
os
.
name
!=
'nt'
:
read_env_flags
.
append
(
'warpctc_dir'
)
read_env_flags
.
append
(
'warpctc_dir'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录