From 6d6ea569dc1e9ff15fdc774c79276b0f79444f5e Mon Sep 17 00:00:00 2001 From: Pei Yang Date: Tue, 6 Apr 2021 13:45:34 +0800 Subject: [PATCH] remove pass restrictions for skip-ln pass (#32081) --- paddle/fluid/framework/ir/skip_layernorm_fuse_pass.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/paddle/fluid/framework/ir/skip_layernorm_fuse_pass.cc b/paddle/fluid/framework/ir/skip_layernorm_fuse_pass.cc index ada20113077..0e63320f2f7 100644 --- a/paddle/fluid/framework/ir/skip_layernorm_fuse_pass.cc +++ b/paddle/fluid/framework/ir/skip_layernorm_fuse_pass.cc @@ -141,14 +141,6 @@ void SkipLayerNormFusePass::ApplyImpl(ir::Graph *graph) const { GET_IR_NODE_FROM_SUBGRAPH(layer_norm_variance, layer_norm_variance, fused_pattern); - // check if is in ernie or not - if (!graph->Has(kEmbEltwiseLayernormPass) || - !graph->Has(kMultiheadMatmulPass)) { - LOG(INFO) << "The skip_layernorm_fuse_pass is only supported in " - << "Ernie/Bert model. Just skip this pass."; - return; - } - std::unordered_set del_node_set; // Create an SkipLayerNorm op node -- GitLab