未验证 提交 e044e842 编写于 作者: C chengduo 提交者: GitHub

open fuse_all_optimizer_ops (#19087)

test=develop
上级 1fc242a7
...@@ -89,7 +89,7 @@ struct BuildStrategy { ...@@ -89,7 +89,7 @@ struct BuildStrategy {
bool fuse_elewise_add_act_ops_{false}; bool fuse_elewise_add_act_ops_{false};
// Fuse_all_optimizer_ops and fuse_all_reduce_ops require that gradients // Fuse_all_optimizer_ops and fuse_all_reduce_ops require that gradients
// should not be sparse types // should not be sparse types
bool fuse_all_optimizer_ops_{false}; bool fuse_all_optimizer_ops_{true};
bool fuse_all_reduce_ops_{false}; bool fuse_all_reduce_ops_{false};
// fuse_relu_depthwise_conv can fuse the `relu -> // fuse_relu_depthwise_conv can fuse the `relu ->
// depthwise_conv` // depthwise_conv`
......
...@@ -65,7 +65,8 @@ class FuseAdamOpPass : public FuseOptimizerOpPass { ...@@ -65,7 +65,8 @@ class FuseAdamOpPass : public FuseOptimizerOpPass {
for (auto &node : not_need_ctrl_var_nodes) { for (auto &node : not_need_ctrl_var_nodes) {
// remove this node from the input op node. // 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(); auto op_node = node->inputs.front();
PADDLE_ENFORCE(op_node->IsOp()); PADDLE_ENFORCE(op_node->IsOp());
op_node->outputs.erase( op_node->outputs.erase(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册