Repository: systemml
Updated Branches:
  refs/heads/master 9080dec7d -> 882eee0fd


[SYSTEMML-2199] Fix special cases IPA function inlining (unique hop IDs)

This patch fixes anomalies of IPA function inlining that showed up on
perftest GLM-predict w/ codegen. The specific scenario was that after
simplification rewrites a function became amenable to inlining and
accordingly inlined during IPA. The function was called twice from a
single statement block (with different inputs) so both called got
replaced by deep copies of the function body DAG. However, because this
DAG deep copy preserved the original IDs we ended up with a DAG where
multiple distinct operators have the same IDs. This causes problems in
the codegen optimizer and compiler because it assumes unique HOP IDs. 

The patch addresses this fundamental issue (which simply never showed up
as an issue before) by globally ensuring unique HOP IDs.


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

Branch: refs/heads/master
Commit: 882eee0fd1c4c3f4d2e36e479e34cb400166fdd6
Parents: 9080dec
Author: Matthias Boehm <[email protected]>
Authored: Sun Mar 18 21:41:54 2018 -0700
Committer: Matthias Boehm <[email protected]>
Committed: Sun Mar 18 21:41:54 2018 -0700

----------------------------------------------------------------------
 src/main/java/org/apache/sysml/hops/Hop.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/systemml/blob/882eee0f/src/main/java/org/apache/sysml/hops/Hop.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/hops/Hop.java 
b/src/main/java/org/apache/sysml/hops/Hop.java
index 78c0687..31ccd33 100644
--- a/src/main/java/org/apache/sysml/hops/Hop.java
+++ b/src/main/java/org/apache/sysml/hops/Hop.java
@@ -73,7 +73,7 @@ public abstract class Hop implements ParseInfo
        // static variable to assign an unique ID to every hop that is created
        private static IDSequence _seqHopID = new IDSequence();
        
-       protected long _ID;
+       protected final long _ID;
        protected String _name;
        protected DataType _dataType;
        protected ValueType _valueType;
@@ -124,10 +124,11 @@ public abstract class Hop implements ParseInfo
        
        protected Hop(){
                //default constructor for clone
+               _ID = getNextHopID();
        }
                
        public Hop(String l, DataType dt, ValueType vt) {
-               _ID = getNextHopID();
+               this();
                setName(l);
                setDataType(dt);
                setValueType(vt);
@@ -1855,7 +1856,6 @@ public abstract class Hop implements ParseInfo
                if( withRefs )
                        throw new CloneNotSupportedException( "Hops deep copy 
w/ lops/inputs/parents not supported." );
                
-               _ID = that._ID;
                _name = that._name;
                _dataType = that._dataType;
                _valueType = that._valueType;

Reply via email to