From 23ba6291cc5bf69b5e21bbfa72d4b1aada282779 Mon Sep 17 00:00:00 2001 From: etone-chan Date: Fri, 12 Jun 2020 11:36:51 +0800 Subject: [PATCH] fix bug of multioutput byway fusion pass --- .../ccsrc/pre_activate/ascend/ascend_backend_optimization.cc | 2 -- .../ascend/buffer_fusion/multi_output_fusion_pass.cc | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mindspore/ccsrc/pre_activate/ascend/ascend_backend_optimization.cc b/mindspore/ccsrc/pre_activate/ascend/ascend_backend_optimization.cc index e517d07ee11..5be725dfb07 100644 --- a/mindspore/ccsrc/pre_activate/ascend/ascend_backend_optimization.cc +++ b/mindspore/ccsrc/pre_activate/ascend/ascend_backend_optimization.cc @@ -66,7 +66,6 @@ #include "pre_activate/ascend/buffer_fusion/ub_pattern_fusion.h" #include "pre_activate/ascend/buffer_fusion/eltwise_fusion_pass.h" #include "pre_activate/ascend/buffer_fusion/multi_output_fusion_pass.h" -#include "pre_activate/ascend/buffer_fusion/stridedread_conv_stridedwrite_fusion_pass.h" #include "pre_activate/ascend/buffer_fusion/conv2dbackprop_eltwise_eltwise_fusion_pass.h" #include "pre_activate/ascend/buffer_fusion/conv2dbackprop_eltwise_fusion_pass.h" #include "pre_activate/ascend/buffer_fusion/conv_single_in_fusion_pass.h" @@ -365,7 +364,6 @@ void AscendBackendUBFusionOptimization(const std::shared_ptr("ub_fusion_pm"); ub_fusion_pm->AddPass(std::make_shared(fusion_id_allocator)); ub_fusion_pm->AddPass(std::make_shared(fusion_id_allocator)); - ub_fusion_pm->AddPass(std::make_shared(fusion_id_allocator)); ub_fusion_pm->AddPass(std::make_shared(fusion_id_allocator)); ub_fusion_pm->AddPass(std::make_shared(fusion_id_allocator)); ub_fusion_pm->AddPass(std::make_shared(fusion_id_allocator)); diff --git a/mindspore/ccsrc/pre_activate/ascend/buffer_fusion/multi_output_fusion_pass.cc b/mindspore/ccsrc/pre_activate/ascend/buffer_fusion/multi_output_fusion_pass.cc index 01f36d40479..4a39ed5eb39 100644 --- a/mindspore/ccsrc/pre_activate/ascend/buffer_fusion/multi_output_fusion_pass.cc +++ b/mindspore/ccsrc/pre_activate/ascend/buffer_fusion/multi_output_fusion_pass.cc @@ -36,6 +36,8 @@ void MultiOutputFusionPass::MatchMultiOutputEltwise(const CNodePtr &cnode, const std::unordered_set record{cnode}; auto eltwise_input = cnode->input(1); if (CheckMultiOutputEltWiseNode(manager.get(), eltwise_input)) { + std::vector output_used_num{SizeToInt(manager->node_users()[eltwise_input].size())}; + AnfAlgo::SetNodeAttr(kAttrOutputUsedNum, MakeValue(output_used_num), eltwise_input); (void)record.insert(eltwise_input); auto input_cnode = eltwise_input->cast(); MS_EXCEPTION_IF_NULL(input_cnode);