From c504a5a1b7d66a1dc5482f20ea0e96a49a406eca Mon Sep 17 00:00:00 2001 From: Michal Gallus Date: Thu, 18 Oct 2018 15:37:15 +0200 Subject: [PATCH] Adjust Conv+bias to placement pass test=develop --- paddle/fluid/framework/ir/conv_bias_mkldnn_fuse_pass.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/paddle/fluid/framework/ir/conv_bias_mkldnn_fuse_pass.cc b/paddle/fluid/framework/ir/conv_bias_mkldnn_fuse_pass.cc index ebb217a70bd..449cc78be15 100644 --- a/paddle/fluid/framework/ir/conv_bias_mkldnn_fuse_pass.cc +++ b/paddle/fluid/framework/ir/conv_bias_mkldnn_fuse_pass.cc @@ -71,6 +71,13 @@ std::unique_ptr ConvBiasFusePass::ApplyImpl( PADDLE_ENFORCE(subgraph.count(conv_input)); + // check if fuse can be done and if MKL-DNN should be used + FuseOptions fuse_option = FindFuseOption(*conv, *eltwise); + if (fuse_option == DO_NOT_FUSE || fuse_option == FUSE_NATIVE) { + VLOG(3) << "do not perform conv+bias fuse"; + return; + } + auto* eltwise_bias_tensor = scope->FindVar(eltwise_bias->Name())->GetMutable(); -- GitLab