[exo] moving ConcatMerge from convert() to optimize() (#8445)
author윤현식/On-Device Lab(SR)/Principal Engineer/삼성전자 <hyunsik.yoon@samsung.com>
Thu, 24 Oct 2019 09:25:25 +0000 (18:25 +0900)
committer박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Thu, 24 Oct 2019 09:25:25 +0000 (18:25 +0900)
ConcatMerge is a pass for TFL nodes. Therefore it would be better to run this pass after completion of canonical nodes to TFL nodes.

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
compiler/exo/src/Convert.cpp
compiler/exo/src/TFLOptimize.cpp
compiler/exo/src/TFLOptimize.h

index 4a7a081..cfada88 100644 (file)
@@ -17,7 +17,8 @@
 #include "Convert.h"
 
 #include "Conversions.h"
-#include "Passes.h"
+#include "Pass/ShapeInferencePass.h"
+#include "Pass/TypeInferencePass.h"
 #include "ProgressReporter.h"
 #include "Knob.h"
 
@@ -112,7 +113,6 @@ void convert_to_TFLNodes(loco::Graph *graph)
     phase.emplace_back(stdex::make_unique<logo::SimplifyDomainConversionPass>());
     phase.emplace_back(stdex::make_unique<logo::RemoveForwardNodePass>());
     phase.emplace_back(stdex::make_unique<logo::RemoveDeadNodePass>());
-    phase.emplace_back(stdex::make_unique<MergeConcatNodesPass>());
   }
 
   logo::PhaseRunner<logo::PhaseStrategy::Restart> phase_runner{graph};
index 163c523..5f7dbd8 100644 (file)
@@ -48,6 +48,8 @@ void optimize(loco::Graph *g)
       phase.emplace_back(stdex::make_unique<FuseReluPass>());
     }
 
+    phase.emplace_back(stdex::make_unique<MergeConcatNodesPass>());
+
     phase.emplace_back(stdex::make_unique<logo::RemoveDeadNodePass>());
   }
 
index 8da9ad2..04d1200 100644 (file)
@@ -22,6 +22,9 @@
 namespace exo
 {
 
+/**
+ * @brief Run passes for a graph after completion of converting canonical nodes into TFL nodes.
+ */
 void optimize(loco::Graph *);
 
 } // namespace exo