This is an automated email from the ASF dual-hosted git repository. niketanpansare pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/systemml.git
The following commit(s) were added to refs/heads/master by this push: new adfa1f9 [SYSTEMML-1325] Fixed GPU cleanup bug when invoked with JMLC. adfa1f9 is described below commit adfa1f962f1155620eedfa48d4f0cbf21e2f6af6 Author: Niketan Pansare <npan...@us.ibm.com> AuthorDate: Tue Mar 5 12:55:30 2019 -0800 [SYSTEMML-1325] Fixed GPU cleanup bug when invoked with JMLC. Closes #854. --- .../sysml/runtime/controlprogram/caching/CacheableData.java | 12 ++++++++---- .../runtime/controlprogram/context/ExecutionContext.java | 6 +++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java index 1d40d72..f0a44f7 100644 --- a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java +++ b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java @@ -624,15 +624,19 @@ public abstract class CacheableData<T extends CacheBlock> extends Data _rddHandle.setBackReference(null); if( _bcHandle != null ) _bcHandle.setBackReference(null); + clearGPUData(); + + // change object state EMPTY + setDirty(false); + setEmpty(); + } + + public void clearGPUData() { if( _gpuObjects != null ) { for (GPUObject gObj : _gpuObjects.values()) if (gObj != null) gObj.clearData(null, gObj.getGPUContext().EAGER_CUDA_FREE); } - - // change object state EMPTY - setDirty(false); - setEmpty(); } public synchronized void exportData() { diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContext.java b/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContext.java index 3e8636b..523396b 100644 --- a/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContext.java +++ b/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContext.java @@ -648,8 +648,12 @@ public class ExecutionContext { Statistics.removeCPMemObject(System.identityHashCode(mo)); //early abort w/o scan of symbol table if no cleanup required boolean fileExists = (mo.isHDFSFileExists() && mo.getFileName() != null); - if( !CacheableData.isCachingActive() && !fileExists ) + if( !CacheableData.isCachingActive() && !fileExists ) { + if ( mo.isCleanupEnabled() && !getVariables().hasReferences(mo) ) + mo.clearGPUData(); return; + } + try { //compute ref count only if matrix cleanup actually necessary