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/25 18:51:26 UTC

[3/4] incubator-systemml git commit: Fix memory estimate correction tsmm (output mem instead of op mem)

Fix memory estimate correction tsmm (output mem instead of op mem)

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

Branch: refs/heads/master
Commit: d16968e567f91882d1fa332736fd7fb56883cf64
Parents: 3631f23
Author: Matthias Boehm <mb...@us.ibm.com>
Authored: Tue Nov 24 21:53:27 2015 -0800
Committer: Matthias Boehm <mb...@us.ibm.com>
Committed: Tue Nov 24 21:53:27 2015 -0800

----------------------------------------------------------------------
 src/main/java/com/ibm/bi/dml/hops/AggBinaryOp.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/d16968e5/src/main/java/com/ibm/bi/dml/hops/AggBinaryOp.java
----------------------------------------------------------------------
diff --git a/src/main/java/com/ibm/bi/dml/hops/AggBinaryOp.java b/src/main/java/com/ibm/bi/dml/hops/AggBinaryOp.java
index 720befa..005744f 100644
--- a/src/main/java/com/ibm/bi/dml/hops/AggBinaryOp.java
+++ b/src/main/java/com/ibm/bi/dml/hops/AggBinaryOp.java
@@ -304,9 +304,12 @@ public class AggBinaryOp extends Hop implements MultiThreadedHop
 		
 		//tsmm left is guaranteed to require only X but not t(X), while
 		//tsmm right might have additional requirements to transpose X if sparse
+		//NOTE: as a heuristic this correction is only applied if not a column vector because
+		//most other vector operations require memory for at least two vectors (we aim for 
+		//consistency in order to prevent anomalies in parfor opt leading to small degree of par)
 		MMTSJType mmtsj = checkTransposeSelf();
-		if( mmtsj.isLeft() && getInput().get(0).dimsKnown() ){
-			_memEstimate = _memEstimate - getInput().get(1)._memEstimate;
+		if( mmtsj.isLeft() && getInput().get(1).dimsKnown() && getInput().get(1).getDim2()>1 ) {
+			_memEstimate = _memEstimate - getInput().get(0)._outputMemEstimate;
 		}
 	}