You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemds.apache.org by mb...@apache.org on 2023/07/14 20:30:24 UTC
[systemds] branch main updated (15c30ea40d -> 1ff3ba9e68)
This is an automated email from the ASF dual-hosted git repository.
mboehm7 pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git
from 15c30ea40d [SYSTEMDS-2834] Python I/O Benchmarking
new 42a131923c [MINOR] Fix robustness and error handling of reading HDF5 datasets
new 1ff3ba9e68 [SYSTEMDS-3315] Fix missing test lineage exploitation in bufferpool
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/main/java/org/apache/sysds/lops/Data.java | 4 +-
.../java/org/apache/sysds/runtime/io/hdf5/H5.java | 2 +-
.../runtime/lineage/LineageRecomputeUtils.java | 2 +-
.../lineage/LineageExploitationBufferPoolTest.java | 45 ++++++++++------------
...up10.dml => LineageExploitationBufferPool2.dml} | 19 ++++-----
5 files changed, 35 insertions(+), 37 deletions(-)
copy src/test/scripts/functions/lineage/{LineageTraceDedup10.dml => LineageExploitationBufferPool2.dml} (82%)
[systemds] 01/02: [MINOR] Fix robustness and error handling of reading HDF5 datasets
Posted by mb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mboehm7 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git
commit 42a131923c92e2603b5933dbfb7822260e7de0cb
Author: Matthias Boehm <mb...@gmail.com>
AuthorDate: Fri Jul 14 20:10:38 2023 +0200
[MINOR] Fix robustness and error handling of reading HDF5 datasets
---
src/main/java/org/apache/sysds/lops/Data.java | 4 ++--
src/main/java/org/apache/sysds/runtime/io/hdf5/H5.java | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/sysds/lops/Data.java b/src/main/java/org/apache/sysds/lops/Data.java
index fc33f0d228..93552852f2 100644
--- a/src/main/java/org/apache/sysds/lops/Data.java
+++ b/src/main/java/org/apache/sysds/lops/Data.java
@@ -576,8 +576,8 @@ public class Data extends Lop
private String createVarHDF5Helper() {
StringBuilder sb = new StringBuilder();
if ( _op.isRead() ) {
- Data datasetNameLop = (Data) getNamedInputLop(DataExpression.HDF5_DATASET_NAME);
- sb.append(datasetNameLop.getStringValue());
+ Data dataset = (Data) getNamedInputLop(DataExpression.HDF5_DATASET_NAME);
+ sb.append(dataset != null ? dataset.getStringValue() : "*");
sb.append(OPERAND_DELIMITOR);
}
else { // (operation == OperationTypes.WRITE)
diff --git a/src/main/java/org/apache/sysds/runtime/io/hdf5/H5.java b/src/main/java/org/apache/sysds/runtime/io/hdf5/H5.java
index ea9ea95058..858f18c39c 100644
--- a/src/main/java/org/apache/sysds/runtime/io/hdf5/H5.java
+++ b/src/main/java/org/apache/sysds/runtime/io/hdf5/H5.java
@@ -133,7 +133,7 @@ public class H5 {
String childName = Utils.readUntilNull(nameBuffer);
if(!childName.equals(datasetName)) {
- throw new H5RuntimeException("The dataset name '" + datasetName + "' not found!");
+ throw new H5RuntimeException("The requested dataset '" + datasetName + "' differs from available '"+childName+"'.");
}
final H5ObjectHeader header = new H5ObjectHeader(rootObject, symbolTableEntry.getObjectHeaderAddress());
[systemds] 02/02: [SYSTEMDS-3315] Fix missing test lineage exploitation in bufferpool
Posted by mb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mboehm7 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git
commit 1ff3ba9e6877aeabd326199205c250b5e261708c
Author: Matthias Boehm <mb...@gmail.com>
AuthorDate: Fri Jul 14 22:29:05 2023 +0200
[SYSTEMDS-3315] Fix missing test lineage exploitation in bufferpool
This patch adds a missing test for the reconstruction of matrices
from lineage if fully evicted from the buffer pool and soft references.
Furthermore, this patch also fixes verbose stats debug output on every
reconstruction.
---
.../runtime/lineage/LineageRecomputeUtils.java | 2 +-
.../lineage/LineageExploitationBufferPoolTest.java | 45 ++++++++++------------
.../lineage/LineageExploitationBufferPool2.dml | 36 +++++++++++++++++
3 files changed, 58 insertions(+), 25 deletions(-)
diff --git a/src/main/java/org/apache/sysds/runtime/lineage/LineageRecomputeUtils.java b/src/main/java/org/apache/sysds/runtime/lineage/LineageRecomputeUtils.java
index c51b1c1e62..747bea28ef 100644
--- a/src/main/java/org/apache/sysds/runtime/lineage/LineageRecomputeUtils.java
+++ b/src/main/java/org/apache/sysds/runtime/lineage/LineageRecomputeUtils.java
@@ -142,7 +142,7 @@ public class LineageRecomputeUtils {
}
ec.setProgram(prog);
prog.execute(ec);
- if (DEBUG || DMLScript.STATISTICS) {
+ if (DEBUG) {
Statistics.stopRunTimer();
System.out.println(Statistics.display(DMLScript.STATISTICS_COUNT));
}
diff --git a/src/test/java/org/apache/sysds/test/functions/lineage/LineageExploitationBufferPoolTest.java b/src/test/java/org/apache/sysds/test/functions/lineage/LineageExploitationBufferPoolTest.java
index 7126396597..52feeb2edb 100644
--- a/src/test/java/org/apache/sysds/test/functions/lineage/LineageExploitationBufferPoolTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/lineage/LineageExploitationBufferPoolTest.java
@@ -21,65 +21,62 @@ package org.apache.sysds.test.functions.lineage;
import org.apache.sysds.hops.OptimizerUtils;
import org.apache.sysds.hops.recompile.Recompiler;
-import org.apache.sysds.runtime.lineage.Lineage;
import org.apache.sysds.test.TestConfiguration;
import org.apache.sysds.test.TestUtils;
import org.junit.Test;
import org.junit.Assert;
import org.apache.sysds.runtime.controlprogram.caching.CacheStatistics;
-import java.util.ArrayList;
-import java.util.List;
-
public class LineageExploitationBufferPoolTest extends LineageBase
{
protected static final String TEST_DIR = "functions/lineage/";
protected static final String TEST_NAME1 = "LineageExploitationBufferPool1";
+ protected static final String TEST_NAME2 = "LineageExploitationBufferPool2";
protected String TEST_CLASS_DIR = TEST_DIR + LineageExploitationBufferPoolTest.class.getSimpleName() + "/";
@Override
public void setUp() {
TestUtils.clearAssertionInformation();
addTestConfiguration(TEST_NAME1, new TestConfiguration(TEST_CLASS_DIR, TEST_NAME1));
+ addTestConfiguration(TEST_NAME2, new TestConfiguration(TEST_CLASS_DIR, TEST_NAME2));
}
@Test
- public void testLineageReusePerf1() { testLineageExploitationBufferPool(TEST_NAME1); }
+ public void testLineageInBufferpool1() {
+ testLineageExploitationBufferPool(TEST_NAME1);
+ }
+
+ @Test
+ public void testLineageInBufferpool2() {
+ testLineageExploitationBufferPool(TEST_NAME2);
+ }
public void testLineageExploitationBufferPool(String testname) {
boolean old_simplification = OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION;
boolean old_sum_product = OptimizerUtils.ALLOW_SUM_PRODUCT_REWRITES;
try {
-
LOG.debug("------------ BEGIN " + testname + "------------");
- // TODO: Simulate memory pressure to test recompute matrix from lineage.
-
OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION = false;
OptimizerUtils.ALLOW_SUM_PRODUCT_REWRITES = false;
getAndLoadTestConfiguration(testname);
fullDMLScriptName = getScript();
- // System.out.println(LineageCacheEviction.getCacheLimit());
-
- // costnsize scheme (computationTime/Size)
- List<String> proArgs = new ArrayList<>();
- // proArgs.clear();
- proArgs.add("-stats");
- proArgs.add("-lineage");
- proArgs.add("-args");
- proArgs.add(output("Z"));
- programArgs = proArgs.toArray(new String[proArgs.size()]);
- Lineage.resetInternalState();
+ programArgs = new String[]{"-stats", "-explain", "-args", output("Z")};
runTest(true, EXCEPTION_NOT_EXPECTED, null, -1);
- Assert.assertEquals(6, CacheStatistics.getLinWrites());
- String[] writes = CacheStatistics.displayWrites().split("/");
- Assert.assertEquals(6, Long.parseLong(writes[0])); // writes WB
- Assert.assertEquals(5, Long.parseLong(writes[1])); // writes WB
-
+ if( testname.equals(TEST_NAME1) ) {
+ Assert.assertEquals(6, CacheStatistics.getLinWrites());
+ String[] writes = CacheStatistics.displayWrites().split("/");
+ Assert.assertEquals(6, Long.parseLong(writes[0])); // writes WB
+ Assert.assertEquals(5, Long.parseLong(writes[1])); // writes WB
+ }
+ else {
+ Assert.assertTrue(CacheStatistics.getLinWrites()==2);
+ Assert.assertTrue(CacheStatistics.getLinHits()>=1);
+ }
} finally {
OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION = old_simplification;
OptimizerUtils.ALLOW_SUM_PRODUCT_REWRITES = old_sum_product;
diff --git a/src/test/scripts/functions/lineage/LineageExploitationBufferPool2.dml b/src/test/scripts/functions/lineage/LineageExploitationBufferPool2.dml
new file mode 100644
index 0000000000..e1838667b9
--- /dev/null
+++ b/src/test/scripts/functions/lineage/LineageExploitationBufferPool2.dml
@@ -0,0 +1,36 @@
+#-------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#-------------------------------------------------------------
+
+X = rand(rows=3e7, cols=1, min=0, max=10)
+Y0 = abs(X);
+Y = Y0;
+
+#force eviction of X and Y
+Z = list();
+for(i in 1:20) {
+ Y = Y + 1;
+ Z = append(Z, Y)
+}
+
+#restore X from lineage
+R = X + Y0 + as.matrix(Z[1]);
+
+write(R, $1, format="text");