[SYSTEMML-1321] Improved dynamic recompilation (stats update p rewrites)

Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-systemml/commit/b641edc1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/b641edc1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/b641edc1

Branch: refs/heads/master
Commit: b641edc165aab129559a5db1bf5e9d050cd30b37
Parents: 7b7b9ba
Author: Matthias Boehm <[email protected]>
Authored: Tue Apr 18 14:27:39 2017 -0700
Committer: Matthias Boehm <[email protected]>
Committed: Wed Apr 19 18:46:30 2017 -0700

----------------------------------------------------------------------
 .../org/apache/sysml/hops/recompile/Recompiler.java  | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/b641edc1/src/main/java/org/apache/sysml/hops/recompile/Recompiler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/hops/recompile/Recompiler.java 
b/src/main/java/org/apache/sysml/hops/recompile/Recompiler.java
index 6b74bf7..6c99d16 100644
--- a/src/main/java/org/apache/sysml/hops/recompile/Recompiler.java
+++ b/src/main/java/org/apache/sysml/hops/recompile/Recompiler.java
@@ -198,8 +198,14 @@ public class Recompiler
                                rUpdateStatistics( hopRoot, vars );
                        
                        // dynamic hop rewrites
-                       if( !inplace )
+                       if( !inplace ) {
                                _rewriter.get().rewriteHopDAGs( hops, null );
+                               
+                               //update stats after rewrites
+                               Hop.resetVisitStatus(hops);
+                               for( Hop hopRoot : hops )
+                                       rUpdateStatistics( hopRoot, vars );
+                       }
                        
                        // refresh memory estimates (based on updated stats,
                        // before: init memo table with propagated worst-case 
estimates,
@@ -303,8 +309,13 @@ public class Recompiler
                        rUpdateStatistics( hops, vars );
                        
                        // dynamic hop rewrites
-                       if( !inplace )
+                       if( !inplace ) {
                                _rewriter.get().rewriteHopDAG( hops, null );
+                               
+                               //update stats after rewrites
+                               hops.resetVisitStatus();
+                               rUpdateStatistics( hops, vars );
+                       }
                        
                        // refresh memory estimates (based on updated stats)
                        MemoTable memo = new MemoTable();

Reply via email to