Repository: systemml Updated Branches: refs/heads/master 1df744d77 -> 8dad38d23
[HOTFIX] Extended codegen pruning of invalid fusion plans This patch hardens the cleanup of invalid fusion plans for issues with the fuse-no-redundancy heuristic. Furthermore, this also fixes some warnings introduced with the recent update to ANTLR 4.7.1. Project: http://git-wip-us.apache.org/repos/asf/systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/8dad38d2 Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/8dad38d2 Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/8dad38d2 Branch: refs/heads/master Commit: 8dad38d23fe02d74dcd8d23c1f292ff1689a3823 Parents: 1df744d Author: Matthias Boehm <mboe...@gmail.com> Authored: Sat Mar 10 16:23:34 2018 -0800 Committer: Matthias Boehm <mboe...@gmail.com> Committed: Sat Mar 10 16:23:34 2018 -0800 ---------------------------------------------------------------------- src/main/java/org/apache/sysml/hops/codegen/SpoofCompiler.java | 6 +++++- .../java/org/apache/sysml/parser/dml/DMLParserWrapper.java | 1 + .../java/org/apache/sysml/parser/pydml/PyDMLParserWrapper.java | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/systemml/blob/8dad38d2/src/main/java/org/apache/sysml/hops/codegen/SpoofCompiler.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/hops/codegen/SpoofCompiler.java b/src/main/java/org/apache/sysml/hops/codegen/SpoofCompiler.java index 28d3821..647a5c8 100644 --- a/src/main/java/org/apache/sysml/hops/codegen/SpoofCompiler.java +++ b/src/main/java/org/apache/sysml/hops/codegen/SpoofCompiler.java @@ -690,6 +690,10 @@ public class SpoofCompiler CNodeTpl tpl = e.getValue().getValue(); Hop[] inHops = e.getValue().getKey(); + //remove invalid plans with null inputs + if( Arrays.stream(inHops).anyMatch(h -> (h==null)) ) + continue; + //perform simplifications and cse rewrites tpl = rewriter.simplifyCPlan(tpl); tpl = cse.eliminateCommonSubexpressions(tpl); @@ -697,7 +701,7 @@ public class SpoofCompiler //update input hops (order-preserving) HashSet<Long> inputHopIDs = tpl.getInputHopIDs(false); inHops = Arrays.stream(inHops) - .filter(p -> inputHopIDs.contains(p.getHopID())) + .filter(p -> p != null && inputHopIDs.contains(p.getHopID())) .toArray(Hop[]::new); cplans2.put(e.getKey(), new Pair<>(inHops, tpl)); http://git-wip-us.apache.org/repos/asf/systemml/blob/8dad38d2/src/main/java/org/apache/sysml/parser/dml/DMLParserWrapper.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/parser/dml/DMLParserWrapper.java b/src/main/java/org/apache/sysml/parser/dml/DMLParserWrapper.java index 8714968..0b9747a 100644 --- a/src/main/java/org/apache/sysml/parser/dml/DMLParserWrapper.java +++ b/src/main/java/org/apache/sysml/parser/dml/DMLParserWrapper.java @@ -71,6 +71,7 @@ import org.apache.sysml.parser.dml.DmlParser.StatementContext; * If in future we intend to make it multi-threaded, look at cleanUpState method and resolve the dependency accordingly. * */ +@SuppressWarnings("deprecation") public class DMLParserWrapper extends ParserWrapper { private static final Log LOG = LogFactory.getLog(DMLScript.class.getName()); http://git-wip-us.apache.org/repos/asf/systemml/blob/8dad38d2/src/main/java/org/apache/sysml/parser/pydml/PyDMLParserWrapper.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/parser/pydml/PyDMLParserWrapper.java b/src/main/java/org/apache/sysml/parser/pydml/PyDMLParserWrapper.java index 8a81b46..2c931a8 100644 --- a/src/main/java/org/apache/sysml/parser/pydml/PyDMLParserWrapper.java +++ b/src/main/java/org/apache/sysml/parser/pydml/PyDMLParserWrapper.java @@ -54,6 +54,7 @@ import org.apache.sysml.parser.pydml.PydmlParser.StatementContext; * Note: ExpressionInfo and StatementInfo are simply wrapper objects and are reused in both DML and PyDML parsers. * */ +@SuppressWarnings("deprecation") public class PyDMLParserWrapper extends ParserWrapper { private static final Log LOG = LogFactory.getLog(DMLScript.class.getName());