Browse Source

!16422 fix build info changed in ssd network

From: @looop5
Reviewed-by: @anyrenwei,@gaoxiong1
Signed-off-by: @gaoxiong1
tags/v1.3.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
4b242fb202
3 changed files with 4 additions and 0 deletions
  1. +1
    -0
      mindspore/ccsrc/backend/optimizer/graph_kernel/graph_kernel_helper.cc
  2. +2
    -0
      mindspore/ccsrc/backend/optimizer/graph_kernel/graph_kernel_optimization.cc
  3. +1
    -0
      mindspore/ccsrc/runtime/device/ascend/kernel_select_ascend.cc

+ 1
- 0
mindspore/ccsrc/backend/optimizer/graph_kernel/graph_kernel_helper.cc View File

@@ -606,6 +606,7 @@ void ResetKernelInfo(const AnfNodePtr &node, KernelType kernel_type) {
#if ENABLE_D
device::ascend::SetKernelInfo(cnode, kernel_type);
#elif ENABLE_GPU
cnode->set_kernel_info(std::make_shared<device::KernelInfo>());
device::gpu::SetKernelInfo(cnode, kernel_type);
#endif
}


+ 2
- 0
mindspore/ccsrc/backend/optimizer/graph_kernel/graph_kernel_optimization.cc View File

@@ -47,6 +47,7 @@ namespace mindspore {
namespace opt {
PassManagerPtr GraphKernelOptimizer::PreProcess() const {
auto pm = std::make_shared<PassManager>("graphkernel_stage1_preprocess");
// Add cse at beginning, otherwise the SpreadUpdateState ir size may be huge in yolov3 network.
pm->AddPass(std::make_shared<CommonSubexpressionElimination>());
// Change Assign(p, a, U) to Assign(Depend(p, U), a)
pm->AddPass(std::make_shared<SplitAssign>());
@@ -58,6 +59,7 @@ PassManagerPtr GraphKernelOptimizer::PreProcess() const {

// Spread the MakeTuple input of UpdateState
pm->AddPass(std::make_shared<SpreadUpdateState>());
// Add cse to reduce the SpreadUpdateState ir size, which is huge in yolov3 network.
pm->AddPass(std::make_shared<CommonSubexpressionElimination>());
return pm;
}


+ 1
- 0
mindspore/ccsrc/runtime/device/ascend/kernel_select_ascend.cc View File

@@ -563,6 +563,7 @@ void SetKernelInfo(const CNodePtr &kernel_node, KernelType kernel_type) {
}
builder->SetKernelType(new_kernel_type);
builder->SetProcessor(new_processor);
kernel_node->set_kernel_info(std::make_shared<device::KernelInfo>());
AnfAlgo::SetSelectKernelBuildInfo(builder->Build(), kernel_node.get());
}
} // namespace ascend


Loading…
Cancel
Save