|
|
|
@@ -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; |
|
|
|
} |
|
|
|
|