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 2018/09/23 19:53:15 UTC

systemml git commit: [MINOR] Performance update-in-place (nnz maintenance, evictions)

Repository: systemml
Updated Branches:
  refs/heads/master f46279a17 -> 2c1fb20ec


[MINOR] Performance update-in-place (nnz maintenance, evictions)

Incl fix for GPU-related compiler warnings (missing imports).

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

Branch: refs/heads/master
Commit: 2c1fb20ecba73417e313172c34bfdde2b9a30b3e
Parents: f46279a
Author: Matthias Boehm <mb...@gmail.com>
Authored: Sun Sep 23 21:48:58 2018 +0200
Committer: Matthias Boehm <mb...@gmail.com>
Committed: Sun Sep 23 21:52:51 2018 +0200

----------------------------------------------------------------------
 .../org/apache/sysml/runtime/controlprogram/ProgramBlock.java   | 4 ++--
 .../sysml/runtime/instructions/gpu/context/GPUObject.java       | 1 -
 .../java/org/apache/sysml/runtime/matrix/data/MatrixBlock.java  | 2 +-
 .../matrix/data/SinglePrecisionCudaSupportFunctions.java        | 5 -----
 4 files changed, 3 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/systemml/blob/2c1fb20e/src/main/java/org/apache/sysml/runtime/controlprogram/ProgramBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/ProgramBlock.java b/src/main/java/org/apache/sysml/runtime/controlprogram/ProgramBlock.java
index 9e049f1..feb1234 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/ProgramBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/ProgramBlock.java
@@ -310,11 +310,11 @@ public class ProgramBlock implements ParseInfo
 					new MatrixBlock(mbVar, MatrixBlock.DEFAULT_INPLACE_SPARSEBLOCK, true) );
 				moNew.setFileName(mo.getFileName()+Lop.UPDATE_INPLACE_PREFIX+tid);
 				mo.release();
-				moNew.release();
-				moNew.setUpdateType(UpdateType.INPLACE);
 				//cleanup old variable (e.g., remove from buffer pool)
 				if( ec.removeVariable(varname) != null )
 					ec.cleanupCacheableData(mo);
+				moNew.release(); //after old removal to avoid unnecessary evictions
+				moNew.setUpdateType(UpdateType.INPLACE);
 				ec.setVariable(varname, moNew);
 			}
 		}

http://git-wip-us.apache.org/repos/asf/systemml/blob/2c1fb20e/src/main/java/org/apache/sysml/runtime/instructions/gpu/context/GPUObject.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/instructions/gpu/context/GPUObject.java b/src/main/java/org/apache/sysml/runtime/instructions/gpu/context/GPUObject.java
index 72d3170..552ee3b 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/gpu/context/GPUObject.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/gpu/context/GPUObject.java
@@ -24,7 +24,6 @@ import static jcuda.runtime.JCuda.cudaMemset;
 import static jcuda.runtime.cudaMemcpyKind.cudaMemcpyDeviceToDevice;
 import static jcuda.runtime.cudaMemcpyKind.cudaMemcpyDeviceToHost;
 
-import java.io.IOException;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.LongAdder;
 

http://git-wip-us.apache.org/repos/asf/systemml/blob/2c1fb20e/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixBlock.java b/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixBlock.java
index 25423c1..4e2a148 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixBlock.java
@@ -1564,7 +1564,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab
 		//no need to clear for awareDestNZ since overwritten 
 		allocateDenseBlock(false);
 		
-		if( awareDestNZ )
+		if( awareDestNZ && (nonZeros!=getLength() || src.nonZeros!=src.getLength()) )
 			nonZeros = nonZeros - recomputeNonZeros(rl, ru, cl, cu) + src.nonZeros;
 		
 		//copy values

http://git-wip-us.apache.org/repos/asf/systemml/blob/2c1fb20e/src/main/java/org/apache/sysml/runtime/matrix/data/SinglePrecisionCudaSupportFunctions.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/SinglePrecisionCudaSupportFunctions.java b/src/main/java/org/apache/sysml/runtime/matrix/data/SinglePrecisionCudaSupportFunctions.java
index dd23871..ee2b664 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/data/SinglePrecisionCudaSupportFunctions.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/data/SinglePrecisionCudaSupportFunctions.java
@@ -22,11 +22,6 @@ import static jcuda.runtime.JCuda.cudaMemcpy;
 import static jcuda.runtime.cudaMemcpyKind.cudaMemcpyDeviceToHost;
 import static jcuda.runtime.cudaMemcpyKind.cudaMemcpyHostToDevice;
 
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.FloatBuffer;
-import java.util.stream.IntStream;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.sysml.conf.ConfigurationManager;