Skip to content

Commit c504a5a

Browse files
committed
Adjust Conv+bias to placement pass
test=develop
1 parent d7509d6 commit c504a5a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

paddle/fluid/framework/ir/conv_bias_mkldnn_fuse_pass.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ std::unique_ptr<ir::Graph> ConvBiasFusePass::ApplyImpl(
7171

7272
PADDLE_ENFORCE(subgraph.count(conv_input));
7373

74+
// check if fuse can be done and if MKL-DNN should be used
75+
FuseOptions fuse_option = FindFuseOption(*conv, *eltwise);
76+
if (fuse_option == DO_NOT_FUSE || fuse_option == FUSE_NATIVE) {
77+
VLOG(3) << "do not perform conv+bias fuse";
78+
return;
79+
}
80+
7481
auto* eltwise_bias_tensor =
7582
scope->FindVar(eltwise_bias->Name())->GetMutable<LoDTensor>();
7683

0 commit comments

Comments
 (0)