This is an automated email from the ASF dual-hosted git repository.

arnabp20 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git


The following commit(s) were added to refs/heads/main by this push:
     new 53a160949c [MINOR] Fix bufferpool eviction for future objects
53a160949c is described below

commit 53a160949cd8c40e19a852b51b3d214b64082772
Author: Arnab Phani <[email protected]>
AuthorDate: Wed Apr 26 23:17:01 2023 +0200

    [MINOR] Fix bufferpool eviction for future objects
---
 .../controlprogram/context/MatrixObjectFuture.java | 30 ++++++++--------------
 .../functions/async/MaxParallelizeOrderTest.java   |  1 -
 2 files changed, 10 insertions(+), 21 deletions(-)

diff --git 
a/src/main/java/org/apache/sysds/runtime/controlprogram/context/MatrixObjectFuture.java
 
b/src/main/java/org/apache/sysds/runtime/controlprogram/context/MatrixObjectFuture.java
index d74cea17a9..a0f390540b 100644
--- 
a/src/main/java/org/apache/sysds/runtime/controlprogram/context/MatrixObjectFuture.java
+++ 
b/src/main/java/org/apache/sysds/runtime/controlprogram/context/MatrixObjectFuture.java
@@ -21,9 +21,11 @@ package org.apache.sysds.runtime.controlprogram.context;
 
 import org.apache.sysds.api.DMLScript;
 import org.apache.sysds.common.Types.ValueType;
+import org.apache.sysds.hops.OptimizerUtils;
 import org.apache.sysds.runtime.DMLRuntimeException;
 import org.apache.sysds.runtime.controlprogram.caching.CacheStatistics;
 import org.apache.sysds.runtime.controlprogram.caching.MatrixObject;
+import org.apache.sysds.runtime.controlprogram.caching.UnifiedMemoryManager;
 import org.apache.sysds.runtime.lineage.LineageCache;
 import org.apache.sysds.runtime.matrix.data.MatrixBlock;
 import org.apache.sysds.utils.stats.SparkStatistics;
@@ -71,32 +73,20 @@ public class MatrixObjectFuture extends MatrixObject
                try {
                        if(!isAvailableToRead())
                                throw new DMLRuntimeException("MatrixObject not 
available to read.");
-                       if(_data != null)
-                               throw new DMLRuntimeException("_data must be 
null for future matrix object/block.");
+                       if (_futureData == null)
+                               return super.acquireRead(); //moved to _data
+
+                       if (OptimizerUtils.isUMMEnabled())
+                               //track and make space in the UMM
+                               UnifiedMemoryManager.pin(this);
+
                        MatrixBlock out = null;
-                       acquire(false, false);
                        long t1 = System.nanoTime();
                        out = _futureData.get();
                        if (hasValidLineage())
                                LineageCache.putValueAsyncOp(getCacheLineage(), 
this, out, t1);
                                // FIXME: start time should indicate the actual 
start of the execution
-                       return out;
-               }
-
-               catch(Exception e) {
-                       throw new DMLRuntimeException(e);
-               }
-       }
-
-       public void release() {
-               releaseIntern();
-       }
-
-       private synchronized void releaseIntern() {
-               try {
-                       if(isCachingActive() && 
_futureData.get().getInMemorySize() > CACHING_THRESHOLD)
-                               _futureData = null;
-                               //TODO: write to disk and other cache 
maintenance
+                       return acquireModify(out);
                }
                catch(Exception e) {
                        throw new DMLRuntimeException(e);
diff --git 
a/src/test/java/org/apache/sysds/test/functions/async/MaxParallelizeOrderTest.java
 
b/src/test/java/org/apache/sysds/test/functions/async/MaxParallelizeOrderTest.java
index 18693b3f4b..2abab6fa42 100644
--- 
a/src/test/java/org/apache/sysds/test/functions/async/MaxParallelizeOrderTest.java
+++ 
b/src/test/java/org/apache/sysds/test/functions/async/MaxParallelizeOrderTest.java
@@ -68,7 +68,6 @@ public class MaxParallelizeOrderTest extends 
AutomatedTestBase {
                runTest(TEST_NAME+"4");
        }
 
-       @Ignore
        @Test
        public void testPCAlm() {
                //eigen is an internal function. Outputs of eigen are not in 
the lop list

Reply via email to