Repository: systemml
Updated Branches:
  refs/heads/master 96ae6c7eb -> 426d7fa0d


[MINOR] Foreign parent check bug in RewriteElementwiseMultChainOpt

Closes #683.

The check for foreign parents in the interior of an element-wise multiply chain 
is incorrect.
Interior element-wise multiply nodes that have a foreign parent which is not a 
BinaryOp (for example, a write DataOp) are missed.
This leads to incorrect rewrites in unlucky DAGs.


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

Branch: refs/heads/master
Commit: 426d7fa0d91a54fd40b4ab90294007f7a2376e43
Parents: 96ae6c7
Author: Dylan Hutchison <dhutc...@cs.washington.edu>
Authored: Wed Oct 11 23:45:01 2017 -0700
Committer: Matthias Boehm <mboe...@gmail.com>
Committed: Wed Oct 11 23:45:01 2017 -0700

----------------------------------------------------------------------
 .../hops/rewrite/RewriteElementwiseMultChainOptimization.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/systemml/blob/426d7fa0/src/main/java/org/apache/sysml/hops/rewrite/RewriteElementwiseMultChainOptimization.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/hops/rewrite/RewriteElementwiseMultChainOptimization.java
 
b/src/main/java/org/apache/sysml/hops/rewrite/RewriteElementwiseMultChainOptimization.java
index 2e411f6..ca7ef2e 100644
--- 
a/src/main/java/org/apache/sysml/hops/rewrite/RewriteElementwiseMultChainOptimization.java
+++ 
b/src/main/java/org/apache/sysml/hops/rewrite/RewriteElementwiseMultChainOptimization.java
@@ -310,7 +310,7 @@ public class RewriteElementwiseMultChainOptimization 
extends HopRewriteRule {
                final ArrayList<Hop> parents = child.getParent();
                if (parents.size() > 1)
                        for (final Hop parent : parents)
-                               if (parent instanceof BinaryOp && 
!emults.contains(parent))
+                               if (!(parent instanceof BinaryOp) || 
!emults.contains(parent))
                                        return false;
                // child does not have foreign parents
 

Reply via email to