From e044e8426499eec87acde7a06e05eef0bf73d1ea Mon Sep 17 00:00:00 2001 From: chengduo <30176695+chengduoZH@users.noreply.github.com> Date: Mon, 12 Aug 2019 14:38:56 +0800 Subject: [PATCH] open fuse_all_optimizer_ops (#19087) test=develop --- paddle/fluid/framework/details/build_strategy.h | 2 +- .../framework/ir/fuse_optimizer_ops_pass/fuse_adam_op_pass.cc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/framework/details/build_strategy.h b/paddle/fluid/framework/details/build_strategy.h index b67a313df6c..929cb51b845 100644 --- a/paddle/fluid/framework/details/build_strategy.h +++ b/paddle/fluid/framework/details/build_strategy.h @@ -89,7 +89,7 @@ struct BuildStrategy { bool fuse_elewise_add_act_ops_{false}; // Fuse_all_optimizer_ops and fuse_all_reduce_ops require that gradients // should not be sparse types - bool fuse_all_optimizer_ops_{false}; + bool fuse_all_optimizer_ops_{true}; bool fuse_all_reduce_ops_{false}; // fuse_relu_depthwise_conv can fuse the `relu -> // depthwise_conv` diff --git a/paddle/fluid/framework/ir/fuse_optimizer_ops_pass/fuse_adam_op_pass.cc b/paddle/fluid/framework/ir/fuse_optimizer_ops_pass/fuse_adam_op_pass.cc index 1dc2474fe1e..997f18d7099 100644 --- a/paddle/fluid/framework/ir/fuse_optimizer_ops_pass/fuse_adam_op_pass.cc +++ b/paddle/fluid/framework/ir/fuse_optimizer_ops_pass/fuse_adam_op_pass.cc @@ -65,7 +65,8 @@ class FuseAdamOpPass : public FuseOptimizerOpPass { for (auto &node : not_need_ctrl_var_nodes) { // remove this node from the input op node. - PADDLE_ENFORCE(!node->inputs.empty()); + PADDLE_ENFORCE(!node->inputs.empty(), + "The input should not be empty here."); auto op_node = node->inputs.front(); PADDLE_ENFORCE(op_node->IsOp()); op_node->outputs.erase( -- GitLab