Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
7f5128f4
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
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看板
未验证
提交
7f5128f4
编写于
10月 14, 2021
作者:
P
Pei Yang
提交者:
GitHub
10月 14, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clean inference logs when config.DisableGlogInfo is triggered (#36356)
上级
8fd1b6ad
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
42 addition
and
33 deletion
+42
-33
paddle/fluid/framework/ir/fc_gru_fuse_pass.cc
paddle/fluid/framework/ir/fc_gru_fuse_pass.cc
+3
-3
paddle/fluid/framework/ir/fc_lstm_fuse_pass.cc
paddle/fluid/framework/ir/fc_lstm_fuse_pass.cc
+3
-3
paddle/fluid/framework/ir/layer_norm_fuse_pass.cc
paddle/fluid/framework/ir/layer_norm_fuse_pass.cc
+3
-2
paddle/fluid/framework/ir/mkldnn/batch_norm_act_fuse_pass.cc
paddle/fluid/framework/ir/mkldnn/batch_norm_act_fuse_pass.cc
+3
-2
paddle/fluid/framework/ir/mkldnn/fc_act_mkldnn_fuse_pass.cc
paddle/fluid/framework/ir/mkldnn/fc_act_mkldnn_fuse_pass.cc
+5
-4
paddle/fluid/framework/ir/mkldnn/matmul_transpose_reshape_fuse_pass.cc
...framework/ir/mkldnn/matmul_transpose_reshape_fuse_pass.cc
+6
-4
paddle/fluid/framework/ir/mkldnn/multi_gru_fuse_pass.cc
paddle/fluid/framework/ir/mkldnn/multi_gru_fuse_pass.cc
+3
-3
paddle/fluid/framework/ir/mkldnn/multi_gru_seq_fuse_pass.cc
paddle/fluid/framework/ir/mkldnn/multi_gru_seq_fuse_pass.cc
+3
-3
paddle/fluid/framework/ir/mkldnn/reshape_transpose_matmul_mkldnn_fuse_pass.cc
...rk/ir/mkldnn/reshape_transpose_matmul_mkldnn_fuse_pass.cc
+8
-7
paddle/fluid/framework/ir/mkldnn/scale_matmul_fuse_pass.cc
paddle/fluid/framework/ir/mkldnn/scale_matmul_fuse_pass.cc
+3
-2
paddle/fluid/inference/analysis/ir_pass_manager.cc
paddle/fluid/inference/analysis/ir_pass_manager.cc
+2
-0
未找到文件。
paddle/fluid/framework/ir/fc_gru_fuse_pass.cc
浏览文件 @
7f5128f4
...
@@ -335,7 +335,7 @@ void FCGRUFusePass::ApplyImpl(ir::Graph* graph) const {
...
@@ -335,7 +335,7 @@ void FCGRUFusePass::ApplyImpl(ir::Graph* graph) const {
graph
,
name_scope_
,
param_scope
(),
true
/*with_fc_bias*/
);
graph
,
name_scope_
,
param_scope
(),
true
/*with_fc_bias*/
);
AddStatis
(
fusion_count
);
AddStatis
(
fusion_count
);
if
(
!
Has
(
"disable_logs"
)
||
!
Get
<
bool
>
(
"disable_logs"
))
string
::
PrettyLogDetail
(
"--- fused %d pairs of fc gru patterns"
,
string
::
PrettyLogDetail
(
"--- fused %d pairs of fc gru patterns"
,
fusion_count
);
fusion_count
);
}
}
...
...
paddle/fluid/framework/ir/fc_lstm_fuse_pass.cc
浏览文件 @
7f5128f4
...
@@ -349,7 +349,7 @@ void FCLstmFusePass::ApplyImpl(ir::Graph* graph) const {
...
@@ -349,7 +349,7 @@ void FCLstmFusePass::ApplyImpl(ir::Graph* graph) const {
BuildFusion
(
graph
,
name_scope_
,
param_scope
(),
true
/*with_fc_bias*/
);
BuildFusion
(
graph
,
name_scope_
,
param_scope
(),
true
/*with_fc_bias*/
);
AddStatis
(
fusion_count
);
AddStatis
(
fusion_count
);
if
(
!
Has
(
"disable_logs"
)
||
!
Get
<
bool
>
(
"disable_logs"
))
string
::
PrettyLogDetail
(
"--- fused %d pairs of fc lstm patterns"
,
string
::
PrettyLogDetail
(
"--- fused %d pairs of fc lstm patterns"
,
fusion_count
);
fusion_count
);
}
}
...
...
paddle/fluid/framework/ir/layer_norm_fuse_pass.cc
浏览文件 @
7f5128f4
...
@@ -351,6 +351,7 @@ void LayerNormFusePass::ApplyImpl(Graph* graph) const {
...
@@ -351,6 +351,7 @@ void LayerNormFusePass::ApplyImpl(Graph* graph) const {
gpd
(
graph
,
handler
);
gpd
(
graph
,
handler
);
AddStatis
(
found_layer_norm_count
);
AddStatis
(
found_layer_norm_count
);
if
(
!
Has
(
"disable_logs"
)
||
!
Get
<
bool
>
(
"disable_logs"
))
PrettyLogDetail
(
"--- Fused %d subgraphs into layer_norm op."
,
PrettyLogDetail
(
"--- Fused %d subgraphs into layer_norm op."
,
found_layer_norm_count
);
found_layer_norm_count
);
}
}
...
...
paddle/fluid/framework/ir/mkldnn/batch_norm_act_fuse_pass.cc
浏览文件 @
7f5128f4
...
@@ -150,6 +150,7 @@ void FuseBatchNormActOneDNNPass::FuseBatchNormAct(
...
@@ -150,6 +150,7 @@ void FuseBatchNormActOneDNNPass::FuseBatchNormAct(
gpd
(
graph
,
handler
);
gpd
(
graph
,
handler
);
AddStatis
(
found_bn_act_count
);
AddStatis
(
found_bn_act_count
);
if
(
!
Has
(
"disable_logs"
)
||
!
Get
<
bool
>
(
"disable_logs"
))
PrettyLogDetail
(
"--- fused %d batch norm with relu activation"
,
PrettyLogDetail
(
"--- fused %d batch norm with relu activation"
,
found_bn_act_count
);
found_bn_act_count
);
}
}
...
...
paddle/fluid/framework/ir/mkldnn/fc_act_mkldnn_fuse_pass.cc
浏览文件 @
7f5128f4
...
@@ -68,9 +68,9 @@ void FuseFCActOneDNNPass::FuseFCAct(Graph *graph,
...
@@ -68,9 +68,9 @@ void FuseFCActOneDNNPass::FuseFCAct(Graph *graph,
bool
approximate
=
BOOST_GET_CONST
(
bool
,
act_op
->
GetAttr
(
"approximate"
));
bool
approximate
=
BOOST_GET_CONST
(
bool
,
act_op
->
GetAttr
(
"approximate"
));
std
::
string
type
=
approximate
?
"_tanh"
:
"_erf"
;
std
::
string
type
=
approximate
?
"_tanh"
:
"_erf"
;
fc_op
->
SetAttr
(
"activation_type"
,
act_type
+
type
);
fc_op
->
SetAttr
(
"activation_type"
,
act_type
+
type
);
}
else
}
else
{
fc_op
->
SetAttr
(
"activation_type"
,
act_type
);
fc_op
->
SetAttr
(
"activation_type"
,
act_type
);
}
fc_op
->
SetAttr
(
"use_mkldnn"
,
true
);
fc_op
->
SetAttr
(
"use_mkldnn"
,
true
);
fc_op
->
SetOutput
(
"Out"
,
{
act_out
->
Name
()});
fc_op
->
SetOutput
(
"Out"
,
{
act_out
->
Name
()});
...
@@ -82,6 +82,7 @@ void FuseFCActOneDNNPass::FuseFCAct(Graph *graph,
...
@@ -82,6 +82,7 @@ void FuseFCActOneDNNPass::FuseFCAct(Graph *graph,
gpd
(
graph
,
handler
);
gpd
(
graph
,
handler
);
AddStatis
(
found_fc_act_count
);
AddStatis
(
found_fc_act_count
);
if
(
!
Has
(
"disable_logs"
)
||
!
Get
<
bool
>
(
"disable_logs"
))
PrettyLogDetail
(
"--- fused %d fc with %s activation"
,
found_fc_act_count
,
PrettyLogDetail
(
"--- fused %d fc with %s activation"
,
found_fc_act_count
,
act_type
);
act_type
);
}
}
...
...
paddle/fluid/framework/ir/mkldnn/matmul_transpose_reshape_fuse_pass.cc
浏览文件 @
7f5128f4
...
@@ -149,10 +149,12 @@ void MatmulTransposeReshapeMKLDNNPass::ApplyImpl(ir::Graph *graph) const {
...
@@ -149,10 +149,12 @@ void MatmulTransposeReshapeMKLDNNPass::ApplyImpl(ir::Graph *graph) const {
gpd
(
graph
,
handler
);
gpd
(
graph
,
handler
);
AddStatis
(
found_matmul_transpose_reshape_count
);
AddStatis
(
found_matmul_transpose_reshape_count
);
if
(
!
Has
(
"disable_logs"
)
||
!
Get
<
bool
>
(
"disable_logs"
))
{
std
::
stringstream
msg_ss
;
std
::
stringstream
msg_ss
;
msg_ss
<<
"--- Fused "
<<
found_matmul_transpose_reshape_count
msg_ss
<<
"--- Fused "
<<
found_matmul_transpose_reshape_count
<<
" MatmulTransposeReshape patterns"
;
<<
" MatmulTransposeReshape patterns"
;
paddle
::
string
::
PrettyLogDetail
(
msg_ss
.
str
().
c_str
());
paddle
::
string
::
PrettyLogDetail
(
msg_ss
.
str
().
c_str
());
}
}
}
}
// namespace ir
}
// namespace ir
}
// namespace framework
}
// namespace framework
...
...
paddle/fluid/framework/ir/mkldnn/multi_gru_fuse_pass.cc
浏览文件 @
7f5128f4
...
@@ -111,7 +111,7 @@ void MultiGRUFusePass::ApplyImpl(ir::Graph* graph) const {
...
@@ -111,7 +111,7 @@ void MultiGRUFusePass::ApplyImpl(ir::Graph* graph) const {
};
};
gpd
(
graph
,
handler
);
gpd
(
graph
,
handler
);
AddStatis
(
fused_count
);
AddStatis
(
fused_count
);
if
(
!
Has
(
"disable_logs"
)
||
!
Get
<
bool
>
(
"disable_logs"
))
PrettyLogDetail
(
"--- fused %d pairs of concatenated multi_gru ops"
,
PrettyLogDetail
(
"--- fused %d pairs of concatenated multi_gru ops"
,
fused_count
);
fused_count
);
}
}
...
...
paddle/fluid/framework/ir/mkldnn/multi_gru_seq_fuse_pass.cc
浏览文件 @
7f5128f4
...
@@ -126,7 +126,7 @@ void MultiGruSeqFusePass::ApplyImpl(ir::Graph* graph) const {
...
@@ -126,7 +126,7 @@ void MultiGruSeqFusePass::ApplyImpl(ir::Graph* graph) const {
};
};
gpd
(
graph
,
handler
);
gpd
(
graph
,
handler
);
AddStatis
(
fused_count
);
AddStatis
(
fused_count
);
if
(
!
Has
(
"disable_logs"
)
||
!
Get
<
bool
>
(
"disable_logs"
))
PrettyLogDetail
(
"--- fused %d sequences of two multi_gru ops"
,
PrettyLogDetail
(
"--- fused %d sequences of two multi_gru ops"
,
fused_count
);
fused_count
);
}
}
...
...
paddle/fluid/framework/ir/mkldnn/reshape_transpose_matmul_mkldnn_fuse_pass.cc
浏览文件 @
7f5128f4
...
@@ -148,13 +148,14 @@ void ReshapeTransposeMatmulMkldnnFusePass::Fuse(
...
@@ -148,13 +148,14 @@ void ReshapeTransposeMatmulMkldnnFusePass::Fuse(
gpd
(
graph
,
handler
);
gpd
(
graph
,
handler
);
AddStatis
(
found_reshape_transpose_matmul_count
);
AddStatis
(
found_reshape_transpose_matmul_count
);
if
(
!
Has
(
"disable_logs"
)
||
!
Get
<
bool
>
(
"disable_logs"
))
{
std
::
stringstream
msg_ss
;
std
::
stringstream
msg_ss
;
msg_ss
<<
"--- Fused "
<<
found_reshape_transpose_matmul_count
msg_ss
<<
"--- Fused "
<<
found_reshape_transpose_matmul_count
<<
" ReshapeTransposeMatmulMkldnn patterns"
;
<<
" ReshapeTransposeMatmulMkldnn patterns"
;
if
(
with_reshape_xshape
)
msg_ss
<<
" with reshape's xshape"
;
if
(
with_reshape_xshape
)
msg_ss
<<
" with reshape's xshape"
;
if
(
with_transpose_xshape
)
msg_ss
<<
" with transpose's xshape"
;
if
(
with_transpose_xshape
)
msg_ss
<<
" with transpose's xshape"
;
string
::
PrettyLogDetail
(
msg_ss
.
str
().
c_str
());
string
::
PrettyLogDetail
(
msg_ss
.
str
().
c_str
());
}
}
}
void
ReshapeTransposeMatmulMkldnnFusePass
::
ApplyImpl
(
ir
::
Graph
*
graph
)
const
{
void
ReshapeTransposeMatmulMkldnnFusePass
::
ApplyImpl
(
ir
::
Graph
*
graph
)
const
{
...
...
paddle/fluid/framework/ir/mkldnn/scale_matmul_fuse_pass.cc
浏览文件 @
7f5128f4
...
@@ -129,6 +129,7 @@ void ScaleMatmulFusePass::ApplyImpl(ir::Graph* graph) const {
...
@@ -129,6 +129,7 @@ void ScaleMatmulFusePass::ApplyImpl(ir::Graph* graph) const {
};
};
gpd
(
graph
,
handler
);
gpd
(
graph
,
handler
);
AddStatis
(
found_scale_matmul_fuse_count
);
AddStatis
(
found_scale_matmul_fuse_count
);
if
(
!
Has
(
"disable_logs"
)
||
!
Get
<
bool
>
(
"disable_logs"
))
PrettyLogDetail
(
"--- fused %d scale with matmul"
,
PrettyLogDetail
(
"--- fused %d scale with matmul"
,
found_scale_matmul_fuse_count
);
found_scale_matmul_fuse_count
);
}
}
...
...
paddle/fluid/inference/analysis/ir_pass_manager.cc
浏览文件 @
7f5128f4
...
@@ -237,6 +237,8 @@ void IRPassManager::CreatePasses(Argument *argument,
...
@@ -237,6 +237,8 @@ void IRPassManager::CreatePasses(Argument *argument,
pass
->
Set
(
"use_fc_padding"
,
new
bool
(
use_fc_padding
));
pass
->
Set
(
"use_fc_padding"
,
new
bool
(
use_fc_padding
));
}
}
pass
->
Set
(
"disable_logs"
,
new
bool
(
disable_logs_
));
pre_pass
=
pass_name
;
pre_pass
=
pass_name
;
passes_
.
emplace_back
(
std
::
move
(
pass
));
passes_
.
emplace_back
(
std
::
move
(
pass
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录