Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
e47d8a57
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看板
未验证
提交
e47d8a57
编写于
8月 05, 2021
作者:
王
王明冬
提交者:
GitHub
8月 05, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[pass_enhance]fix the mkldnn model performance drop problem. test=develop (#34625)
上级
4d6f8f2a
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
20 addition
and
9 deletion
+20
-9
paddle/fluid/framework/ir/adaptive_pool2d_convert_global_pass.cc
...fluid/framework/ir/adaptive_pool2d_convert_global_pass.cc
+1
-0
paddle/fluid/framework/ir/conv_affine_channel_fuse_pass.cc
paddle/fluid/framework/ir/conv_affine_channel_fuse_pass.cc
+4
-2
paddle/fluid/framework/ir/conv_bn_fuse_pass.cc
paddle/fluid/framework/ir/conv_bn_fuse_pass.cc
+2
-0
paddle/fluid/framework/ir/conv_elementwise_add2_act_fuse_pass.cc
...fluid/framework/ir/conv_elementwise_add2_act_fuse_pass.cc
+1
-0
paddle/fluid/framework/ir/mkldnn/conv_bias_mkldnn_fuse_pass.cc
...e/fluid/framework/ir/mkldnn/conv_bias_mkldnn_fuse_pass.cc
+4
-1
paddle/fluid/framework/ir/mkldnn/conv_elementwise_add_mkldnn_fuse_pass.cc
...mework/ir/mkldnn/conv_elementwise_add_mkldnn_fuse_pass.cc
+6
-5
paddle/fluid/framework/ir/mkldnn/cpu_quantize_squash_pass.cc
paddle/fluid/framework/ir/mkldnn/cpu_quantize_squash_pass.cc
+1
-1
paddle/fluid/framework/ir/quant_conv2d_dequant_fuse_pass.cc
paddle/fluid/framework/ir/quant_conv2d_dequant_fuse_pass.cc
+1
-0
未找到文件。
paddle/fluid/framework/ir/adaptive_pool2d_convert_global_pass.cc
浏览文件 @
e47d8a57
...
@@ -60,6 +60,7 @@ AdaptivePool2dConvertGlobalPass::AdaptivePool2dConvertGlobalPass() {
...
@@ -60,6 +60,7 @@ AdaptivePool2dConvertGlobalPass::AdaptivePool2dConvertGlobalPass() {
.
IsStringIn
({
"NHWC"
,
"NCHW"
})
.
IsStringIn
({
"NHWC"
,
"NCHW"
})
.
End
()
.
End
()
.
AddAttr
(
"padding_algorithm"
)
.
AddAttr
(
"padding_algorithm"
)
.
IsOptional
()
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
End
();
.
End
();
}
}
...
...
paddle/fluid/framework/ir/conv_affine_channel_fuse_pass.cc
浏览文件 @
e47d8a57
...
@@ -120,6 +120,7 @@ ConvAffineChannelFusePass::ConvAffineChannelFusePass() {
...
@@ -120,6 +120,7 @@ ConvAffineChannelFusePass::ConvAffineChannelFusePass() {
.
IsType
<
std
::
vector
<
int
>>
()
.
IsType
<
std
::
vector
<
int
>>
()
.
End
()
.
End
()
.
AddAttr
(
"padding_algorithm"
)
.
AddAttr
(
"padding_algorithm"
)
.
IsOptional
()
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
End
()
.
End
()
.
AddAttr
(
"groups"
)
.
AddAttr
(
"groups"
)
...
@@ -129,7 +130,7 @@ ConvAffineChannelFusePass::ConvAffineChannelFusePass() {
...
@@ -129,7 +130,7 @@ ConvAffineChannelFusePass::ConvAffineChannelFusePass() {
.
IsType
<
std
::
vector
<
int
>>
()
.
IsType
<
std
::
vector
<
int
>>
()
.
End
()
.
End
()
.
AddAttr
(
"data_format"
)
.
AddAttr
(
"data_format"
)
.
IsStringIn
({
"NCHW"
,
"NHWC"
})
.
IsStringIn
({
"NCHW"
,
"NHWC"
,
"AnyLayout"
})
.
End
();
.
End
();
AddOpCompat
(
OpCompat
(
"affine_channel"
))
AddOpCompat
(
OpCompat
(
"affine_channel"
))
...
@@ -267,6 +268,7 @@ ConvEltwiseAddAffineChannelFusePass::ConvEltwiseAddAffineChannelFusePass() {
...
@@ -267,6 +268,7 @@ ConvEltwiseAddAffineChannelFusePass::ConvEltwiseAddAffineChannelFusePass() {
.
IsType
<
std
::
vector
<
int
>>
()
.
IsType
<
std
::
vector
<
int
>>
()
.
End
()
.
End
()
.
AddAttr
(
"padding_algorithm"
)
.
AddAttr
(
"padding_algorithm"
)
.
IsOptional
()
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
End
()
.
End
()
.
AddAttr
(
"groups"
)
.
AddAttr
(
"groups"
)
...
@@ -276,7 +278,7 @@ ConvEltwiseAddAffineChannelFusePass::ConvEltwiseAddAffineChannelFusePass() {
...
@@ -276,7 +278,7 @@ ConvEltwiseAddAffineChannelFusePass::ConvEltwiseAddAffineChannelFusePass() {
.
IsType
<
std
::
vector
<
int
>>
()
.
IsType
<
std
::
vector
<
int
>>
()
.
End
()
.
End
()
.
AddAttr
(
"data_format"
)
.
AddAttr
(
"data_format"
)
.
IsStringIn
({
"NCHW"
,
"NHWC"
})
.
IsStringIn
({
"NCHW"
,
"NHWC"
,
"AnyLayout"
})
.
End
();
.
End
();
AddOpCompat
(
OpCompat
(
"affine_channel"
))
AddOpCompat
(
OpCompat
(
"affine_channel"
))
.
AddInput
(
"X"
)
.
AddInput
(
"X"
)
...
...
paddle/fluid/framework/ir/conv_bn_fuse_pass.cc
浏览文件 @
e47d8a57
...
@@ -620,6 +620,7 @@ ConvTransposeBNFusePass::ConvTransposeBNFusePass() {
...
@@ -620,6 +620,7 @@ ConvTransposeBNFusePass::ConvTransposeBNFusePass() {
.
IsType
<
std
::
vector
<
int
>>
()
.
IsType
<
std
::
vector
<
int
>>
()
.
End
()
.
End
()
.
AddAttr
(
"padding_algorithm"
)
.
AddAttr
(
"padding_algorithm"
)
.
IsOptional
()
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
End
()
.
End
()
.
AddAttr
(
"data_format"
)
.
AddAttr
(
"data_format"
)
...
@@ -663,6 +664,7 @@ ConvTransposeEltwiseAddBNFusePass::ConvTransposeEltwiseAddBNFusePass() {
...
@@ -663,6 +664,7 @@ ConvTransposeEltwiseAddBNFusePass::ConvTransposeEltwiseAddBNFusePass() {
.
IsType
<
std
::
vector
<
int
>>
()
.
IsType
<
std
::
vector
<
int
>>
()
.
End
()
.
End
()
.
AddAttr
(
"padding_algorithm"
)
.
AddAttr
(
"padding_algorithm"
)
.
IsOptional
()
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
End
()
.
End
()
.
AddAttr
(
"data_format"
)
.
AddAttr
(
"data_format"
)
...
...
paddle/fluid/framework/ir/conv_elementwise_add2_act_fuse_pass.cc
浏览文件 @
e47d8a57
...
@@ -68,6 +68,7 @@ ConvElementwiseAdd2ActFusePass::ConvElementwiseAdd2ActFusePass() {
...
@@ -68,6 +68,7 @@ ConvElementwiseAdd2ActFusePass::ConvElementwiseAdd2ActFusePass() {
.
AddAttr
(
"paddings"
)
.
AddAttr
(
"paddings"
)
.
End
()
.
End
()
.
AddAttr
(
"padding_algorithm"
)
.
AddAttr
(
"padding_algorithm"
)
.
IsOptional
()
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
End
()
.
End
()
.
AddAttr
(
"groups"
)
.
AddAttr
(
"groups"
)
...
...
paddle/fluid/framework/ir/mkldnn/conv_bias_mkldnn_fuse_pass.cc
浏览文件 @
e47d8a57
...
@@ -47,6 +47,7 @@ ConvBiasFusePass::ConvBiasFusePass() {
...
@@ -47,6 +47,7 @@ ConvBiasFusePass::ConvBiasFusePass() {
.
IsType
<
std
::
vector
<
int
>>
()
.
IsType
<
std
::
vector
<
int
>>
()
.
End
()
.
End
()
.
AddAttr
(
"padding_algorithm"
)
.
AddAttr
(
"padding_algorithm"
)
.
IsOptional
()
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
End
()
.
End
()
.
AddAttr
(
"groups"
)
.
AddAttr
(
"groups"
)
...
@@ -56,7 +57,7 @@ ConvBiasFusePass::ConvBiasFusePass() {
...
@@ -56,7 +57,7 @@ ConvBiasFusePass::ConvBiasFusePass() {
.
IsType
<
std
::
vector
<
int
>>
()
.
IsType
<
std
::
vector
<
int
>>
()
.
End
()
.
End
()
.
AddAttr
(
"data_format"
)
.
AddAttr
(
"data_format"
)
.
IsStringIn
({
"NCHW"
,
"NHWC"
})
.
IsStringIn
({
"NCHW"
,
"NHWC"
,
"AnyLayout"
})
.
End
();
.
End
();
AddOpCompat
(
OpCompat
(
"elementwise_add"
))
AddOpCompat
(
OpCompat
(
"elementwise_add"
))
...
@@ -110,6 +111,7 @@ Conv2DTransposeBiasFusePass::Conv2DTransposeBiasFusePass() {
...
@@ -110,6 +111,7 @@ Conv2DTransposeBiasFusePass::Conv2DTransposeBiasFusePass() {
.
IsType
<
std
::
vector
<
int
>>
()
.
IsType
<
std
::
vector
<
int
>>
()
.
End
()
.
End
()
.
AddAttr
(
"padding_algorithm"
)
.
AddAttr
(
"padding_algorithm"
)
.
IsOptional
()
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
End
()
.
End
()
.
AddAttr
(
"data_format"
)
.
AddAttr
(
"data_format"
)
...
@@ -135,6 +137,7 @@ Conv3DBiasFusePass::Conv3DBiasFusePass() {
...
@@ -135,6 +137,7 @@ Conv3DBiasFusePass::Conv3DBiasFusePass() {
.
IsType
<
std
::
vector
<
int
>>
()
.
IsType
<
std
::
vector
<
int
>>
()
.
End
()
.
End
()
.
AddAttr
(
"padding_algorithm"
)
.
AddAttr
(
"padding_algorithm"
)
.
IsOptional
()
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
End
()
.
End
()
.
AddAttr
(
"groups"
)
.
AddAttr
(
"groups"
)
...
...
paddle/fluid/framework/ir/mkldnn/conv_elementwise_add_mkldnn_fuse_pass.cc
浏览文件 @
e47d8a57
...
@@ -158,11 +158,6 @@ void ResidualConnectionMKLDNNFusePass::IdentityFuseHandle::operator()(
...
@@ -158,11 +158,6 @@ void ResidualConnectionMKLDNNFusePass::IdentityFuseHandle::operator()(
Node
*
elementwise_add_op
;
Node
*
elementwise_add_op
;
Node
*
elementwise_add_identity
;
Node
*
elementwise_add_identity
;
Node
*
elementwise_add_out
;
Node
*
elementwise_add_out
;
if
(
!
pass_
->
IsCompat
(
subgraph
,
graph
))
{
LOG
(
WARNING
)
<<
"conv_elementwise_add_mkldnn_fuse_pass in op compat failed."
;
return
;
}
std
::
tie
(
conv_op
,
conv_input
,
conv_filter
,
conv_output
)
=
std
::
tie
(
conv_op
,
conv_input
,
conv_filter
,
conv_output
)
=
get_node_from_conv_op
(
subgraph
);
get_node_from_conv_op
(
subgraph
);
...
@@ -175,6 +170,12 @@ void ResidualConnectionMKLDNNFusePass::IdentityFuseHandle::operator()(
...
@@ -175,6 +170,12 @@ void ResidualConnectionMKLDNNFusePass::IdentityFuseHandle::operator()(
if
(
HasFusedActivation
(
conv_op
))
return
;
if
(
HasFusedActivation
(
conv_op
))
return
;
if
(
!
pass_
->
IsCompat
(
subgraph
,
graph
))
{
LOG
(
WARNING
)
<<
"conv_elementwise_add_mkldnn_fuse_pass in op compat failed."
;
return
;
}
conv_op
->
Op
()
->
SetInput
(
"ResidualData"
,
{
elementwise_add_identity
->
Name
()});
conv_op
->
Op
()
->
SetInput
(
"ResidualData"
,
{
elementwise_add_identity
->
Name
()});
conv_op
->
Op
()
->
SetOutput
(
"Output"
,
{
elementwise_add_out
->
Name
()});
conv_op
->
Op
()
->
SetOutput
(
"Output"
,
{
elementwise_add_out
->
Name
()});
conv_op
->
Op
()
->
SetAttr
(
"fuse_residual_connection"
,
true
);
conv_op
->
Op
()
->
SetAttr
(
"fuse_residual_connection"
,
true
);
...
...
paddle/fluid/framework/ir/mkldnn/cpu_quantize_squash_pass.cc
浏览文件 @
e47d8a57
...
@@ -77,7 +77,7 @@ CPUQuantizeSquashPass::CPUQuantizeSquashPass() {
...
@@ -77,7 +77,7 @@ CPUQuantizeSquashPass::CPUQuantizeSquashPass() {
.
End
()
.
End
()
.
AddAttr
(
"data_format"
)
.
AddAttr
(
"data_format"
)
.
IsOptional
()
.
IsOptional
()
.
IsStringIn
({
"NCHW"
,
"NHWC"
})
.
IsStringIn
({
"NCHW"
,
"NHWC"
,
"AnyLayout"
})
.
End
();
.
End
();
}
}
...
...
paddle/fluid/framework/ir/quant_conv2d_dequant_fuse_pass.cc
浏览文件 @
e47d8a57
...
@@ -243,6 +243,7 @@ QuantDequantFusePass::QuantDequantFusePass() {
...
@@ -243,6 +243,7 @@ QuantDequantFusePass::QuantDequantFusePass() {
.
IsType
<
std
::
vector
<
int
>>
()
.
IsType
<
std
::
vector
<
int
>>
()
.
End
()
.
End
()
.
AddAttr
(
"padding_algorithm"
)
.
AddAttr
(
"padding_algorithm"
)
.
IsOptional
()
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
IsStringIn
({
"EXPLICIT"
,
"SAME"
,
"VALID"
})
.
End
()
.
End
()
.
AddAttr
(
"data_format"
)
.
AddAttr
(
"data_format"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录