From bbd79d25d85dfabe338917aec81cb555a096e024 Mon Sep 17 00:00:00 2001 From: Matthias Boehm Date: Sat, 28 Sep 2024 21:38:30 +0200 Subject: [PATCH] [MINOR] Fix incremental SliceLine pruning configurations This patch fixes the disabled approximate pruning strategy, as well as moves some of the tests (by correct alphabetical order) to builtin-part1 which also reduces the chances of timeouts. --- scripts/builtin/incSliceLine.dml | 16 ++++++++-------- .../BuiltinDifferenceStatistics.java | 2 +- .../BuiltinIncSliceLineTest.java | 2 +- .../functions/builtin/incSliceLineFull.dml | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) rename src/test/java/org/apache/sysds/test/functions/builtin/{part2 => part1}/BuiltinDifferenceStatistics.java (98%) rename src/test/java/org/apache/sysds/test/functions/builtin/{part2 => part1}/BuiltinIncSliceLineTest.java (99%) diff --git a/scripts/builtin/incSliceLine.dml b/scripts/builtin/incSliceLine.dml index 0eef76340ea..aa001936f2c 100644 --- a/scripts/builtin/incSliceLine.dml +++ b/scripts/builtin/incSliceLine.dml @@ -52,8 +52,9 @@ # prevTK previous top-k slices (for incremental updates) # prevTKC previous top-k scores (for incremental updates) # encodeLat flag for encoding output lattice for less memory consumption -# pruningStrat pruning strategy: 0 all pruning, 1 only score pruning, 2 only size pruning, -# 3 only max score pruning, 4 only approx pruning, 5 no pruning +# pruningStrat pruning strategy: 0 all pruning, 1 all exact pruning, +# 2 only score pruning, 3 only max score pruning, +# 4 only size pruning, 5 no pruning # --------------------------------------------------------------------------------------- # # OUTPUT: @@ -82,7 +83,7 @@ m_incSliceLine = function( list[unknown] prevLattice = list(), list[unknown] metaPrevLattice = list(), list[unknown] prevStats = list(), Matrix[Double] prevTK = matrix(0,0,0), Matrix[Double] prevTKC = matrix(0,0,0), Boolean encodeLat = TRUE, - Int pruningStrat = 0) + Int pruningStrat = 1) return( Matrix[Double] TK, Matrix[Double] TKC, Matrix[Double] D, list[unknown] L, list[unknown] metaLattice, @@ -101,11 +102,10 @@ m_incSliceLine = function( + " -- see documentation for more details."); } - enableIncScorePruning = ( pruningStrat <= 1); - enableIncSizePruning = ((pruningStrat == 0) | (pruningStrat == 2)); - enableIncMaxScorePruning = ((pruningStrat == 0) | (pruningStrat == 3)); - enableIncApproxPruning = ((pruningStrat == 0) | (pruningStrat == 4)); - enableIncApproxPruning = FALSE; + enableIncScorePruning = (pruningStrat <= 2); + enableIncSizePruning = (pruningStrat <= 1 | pruningStrat == 4); + enableIncMaxScorePruning = (pruningStrat <= 1 | pruningStrat == 3); + enableIncApproxPruning = (pruningStrat == 0); t1 = time(); diff --git a/src/test/java/org/apache/sysds/test/functions/builtin/part2/BuiltinDifferenceStatistics.java b/src/test/java/org/apache/sysds/test/functions/builtin/part1/BuiltinDifferenceStatistics.java similarity index 98% rename from src/test/java/org/apache/sysds/test/functions/builtin/part2/BuiltinDifferenceStatistics.java rename to src/test/java/org/apache/sysds/test/functions/builtin/part1/BuiltinDifferenceStatistics.java index 1ec6dccd8a6..488a5a78079 100644 --- a/src/test/java/org/apache/sysds/test/functions/builtin/part2/BuiltinDifferenceStatistics.java +++ b/src/test/java/org/apache/sysds/test/functions/builtin/part1/BuiltinDifferenceStatistics.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.sysds.test.functions.builtin.part2; +package org.apache.sysds.test.functions.builtin.part1; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; diff --git a/src/test/java/org/apache/sysds/test/functions/builtin/part2/BuiltinIncSliceLineTest.java b/src/test/java/org/apache/sysds/test/functions/builtin/part1/BuiltinIncSliceLineTest.java similarity index 99% rename from src/test/java/org/apache/sysds/test/functions/builtin/part2/BuiltinIncSliceLineTest.java rename to src/test/java/org/apache/sysds/test/functions/builtin/part1/BuiltinIncSliceLineTest.java index 9aa278b7965..83c39d6d4bb 100644 --- a/src/test/java/org/apache/sysds/test/functions/builtin/part2/BuiltinIncSliceLineTest.java +++ b/src/test/java/org/apache/sysds/test/functions/builtin/part1/BuiltinIncSliceLineTest.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.sysds.test.functions.builtin.part2; +package org.apache.sysds.test.functions.builtin.part1; import org.junit.Assert; import org.junit.Test; diff --git a/src/test/scripts/functions/builtin/incSliceLineFull.dml b/src/test/scripts/functions/builtin/incSliceLineFull.dml index f255c9ef0c4..db73cdaab7a 100644 --- a/src/test/scripts/functions/builtin/incSliceLineFull.dml +++ b/src/test/scripts/functions/builtin/incSliceLineFull.dml @@ -30,13 +30,13 @@ disableIncScorePruning = $13; disableIncSizePruning = $14; if(disableIncScorePruning & disableIncSizePruning){ - pruningStrat = 3; + pruningStrat = 5; } else if (disableIncSizePruning){ pruningStrat = 2; } else if (disableIncScorePruning){ - pruningStrat = 1; + pruningStrat = 4; } else { - pruningStrat = 0; + pruningStrat = 1; }