You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by mb...@apache.org on 2015/11/23 04:52:58 UTC

[3/8] incubator-systemml git commit: Improved right indexing hop size inference (block indexing), for kmeans

Improved right indexing hop size inference (block indexing), for kmeans

The parfor optimizer injects repartition operations if there are zipmm
or cpmm (unknown) matrix mult instructions in the body in order to avoid
shuffle per iteration. For kmeans, we encountered false positives, where
we injected repartition operations but executed mapmm in the body, which
rendered the repartition overhead unnecessary. This change improves the
size inference logic of right indexing hops such that, for kmeans, all
sizes of matrix multiplications can be inferred and thus avoids
unnecessary repartitioning.

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

Branch: refs/heads/master
Commit: 3adca729d5039b646c8820cc77b23ccd4c467fa3
Parents: abcebc6
Author: Matthias Boehm <mb...@us.ibm.com>
Authored: Fri Nov 20 20:56:29 2015 -0800
Committer: Matthias Boehm <mb...@us.ibm.com>
Committed: Sun Nov 22 19:37:12 2015 -0800

----------------------------------------------------------------------
 src/main/java/com/ibm/bi/dml/hops/IndexingOp.java | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/3adca729/src/main/java/com/ibm/bi/dml/hops/IndexingOp.java
----------------------------------------------------------------------
diff --git a/src/main/java/com/ibm/bi/dml/hops/IndexingOp.java b/src/main/java/com/ibm/bi/dml/hops/IndexingOp.java
index a46781a..b351d61 100644
--- a/src/main/java/com/ibm/bi/dml/hops/IndexingOp.java
+++ b/src/main/java/com/ibm/bi/dml/hops/IndexingOp.java
@@ -33,7 +33,6 @@ import com.ibm.bi.dml.runtime.matrix.MatrixCharacteristics;
 //for now only works for range based indexing op
 public class IndexingOp extends Hop 
 {
-	
 	public static String OPSTRING = "rix"; //"Indexing";
 	
 	private boolean _rowLowerEqualsUpper = false;
@@ -417,6 +416,10 @@ public class IndexingOp extends Hop
 			setDim1( HopRewriteUtils.getIntValueSafe((LiteralOp)input3)
 					-HopRewriteUtils.getIntValueSafe((LiteralOp)input2)+1 );
 		}
+		else if( isBlockIndexingExpression(input2, input3) ) {
+			setDim1(getBlockIndexingExpressionSize(input2, input3));
+		}
+		
 		if( _colLowerEqualsUpper ) //COLS
 			setDim2(1);
 		else if( allCols ) 
@@ -424,7 +427,10 @@ public class IndexingOp extends Hop
 		else if( constColRange ){
 			setDim2( HopRewriteUtils.getIntValueSafe((LiteralOp)input5)
 					-HopRewriteUtils.getIntValueSafe((LiteralOp)input4)+1 );
-		} 
+		}
+		else if( isBlockIndexingExpression(input4, input5) ) {
+			setDim2(getBlockIndexingExpressionSize(input4, input5));
+		}
 	}
 	
 	@Override