File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -713,10 +713,6 @@ bool needsGradient(const std::shared_ptr<const Graph>& graph) {
713713}
714714
715715void runNondiffOptimization (std::shared_ptr<Graph>& graph) {
716- // run custom passes that different backends can register
717- for (const auto & pass : getCustomPasses ()) {
718- pass (graph);
719- }
720716 // decomposition pass, decompose certain ops that will be used in the
721717 // following passes (like batchmm and jit fusion)
722718 DecomposeOps (graph);
@@ -732,6 +728,12 @@ void runNondiffOptimization(std::shared_ptr<Graph>& graph) {
732728 QuantFusion (graph);
733729
734730 FuseGraph (graph);
731+
732+ // Run custom passes that different backends can register.
733+ // This is done last to give internal optimization passes priority.
734+ for (const auto & pass : getCustomPasses ()) {
735+ pass (graph);
736+ }
735737}
736738
737739void runOptimization (std::shared_ptr<Graph>& graph) {
You can’t perform that action at this time.
0 commit comments