This is an automated email from the ASF dual-hosted git repository.
arnabp20 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/systemds.git
The following commit(s) were added to refs/heads/master by this push:
new b87001b [MINOR] Update default lineage cache eviction policy to
COSTNSIZE
b87001b is described below
commit b87001b11101fc32ece6618922b73a5c5741a2e3
Author: arnabp <[email protected]>
AuthorDate: Mon Jan 25 17:43:26 2021 +0100
[MINOR] Update default lineage cache eviction policy to COSTNSIZE
---
src/main/java/org/apache/sysds/api/DMLOptions.java | 4 +---
.../sysds/runtime/lineage/LineageCacheConfig.java | 20 ++++----------------
2 files changed, 5 insertions(+), 19 deletions(-)
diff --git a/src/main/java/org/apache/sysds/api/DMLOptions.java
b/src/main/java/org/apache/sysds/api/DMLOptions.java
index 0d82a50..2e95456 100644
--- a/src/main/java/org/apache/sysds/api/DMLOptions.java
+++ b/src/main/java/org/apache/sysds/api/DMLOptions.java
@@ -62,7 +62,7 @@ public class DMLOptions {
public boolean lineage = false; //
whether compute lineage trace
public boolean lineage_dedup = false; //
whether deduplicate lineage items
public ReuseCacheType linReuseType = ReuseCacheType.NONE; //
reuse type (full, partial, hybrid)
- public LineageCachePolicy linCachePolicy= LineageCachePolicy.HYBRID;
// lineage cache eviction policy
+ public LineageCachePolicy linCachePolicy=
LineageCachePolicy.COSTNSIZE; // lineage cache eviction policy
public boolean lineage_estimate = false; //
whether estimate reuse benefits
public boolean fedWorker = false;
public int fedWorkerPort = -1;
@@ -136,8 +136,6 @@ public class DMLOptions {
dmlOptions.linCachePolicy = LineageCachePolicy.COSTNSIZE;
else if
(lineageType.equalsIgnoreCase("policy_dagheight"))
dmlOptions.linCachePolicy = LineageCachePolicy.DAGHEIGHT;
- else if
(lineageType.equalsIgnoreCase("policy_hybrid"))
-
dmlOptions.linCachePolicy = LineageCachePolicy.HYBRID;
else if
(lineageType.equalsIgnoreCase("estimate"))
dmlOptions.lineage_estimate = lineageType.equalsIgnoreCase("estimate");
else
diff --git
a/src/main/java/org/apache/sysds/runtime/lineage/LineageCacheConfig.java
b/src/main/java/org/apache/sysds/runtime/lineage/LineageCacheConfig.java
index 2532d14..96604d2 100644
--- a/src/main/java/org/apache/sysds/runtime/lineage/LineageCacheConfig.java
+++ b/src/main/java/org/apache/sysds/runtime/lineage/LineageCacheConfig.java
@@ -106,8 +106,8 @@ public class LineageCacheConfig
//-------------EVICTION RELATED CONFIGURATIONS--------------//
private static LineageCachePolicy _cachepolicy = null;
- // Weights for scoring components (computeTime/size, LRU timestamp)
- protected static double[] WEIGHTS = {0, 1, 0};
+ // Weights for scoring components (computeTime/size, LRU timestamp, DAG
height)
+ protected static double[] WEIGHTS = {1, 0, 0};
protected enum LineageCacheStatus {
EMPTY, //Placeholder with no data. Cannot be evicted.
@@ -126,7 +126,6 @@ public class LineageCacheConfig
LRU,
COSTNSIZE,
DAGHEIGHT,
- HYBRID;
}
protected static Comparator<LineageCacheEntry> LineageCacheComparator =
(e1, e2) -> {
@@ -158,9 +157,6 @@ public class LineageCacheConfig
e1_ts < e2_ts ? -1 : 1;
break;
}
- case HYBRID:
- // order entries with same score by IDs
- ret = Long.compare(e1._key.getId(),
e2._key.getId());
}
}
else
@@ -175,7 +171,7 @@ public class LineageCacheConfig
//setup static configuration parameters
REUSE_OPCODES = OPCODES;
setSpill(true);
- setCachePolicy(LineageCachePolicy.HYBRID);
+ setCachePolicy(LineageCachePolicy.COSTNSIZE);
setCompAssRW(true);
}
@@ -271,6 +267,7 @@ public class LineageCacheConfig
}
public static void setCachePolicy(LineageCachePolicy policy) {
+ // TODO: Automatic tuning of weights.
switch(policy) {
case LRU:
WEIGHTS[0] = 0; WEIGHTS[1] = 1; WEIGHTS[2] = 0;
@@ -281,15 +278,6 @@ public class LineageCacheConfig
case DAGHEIGHT:
WEIGHTS[0] = 0; WEIGHTS[1] = 0; WEIGHTS[2] = 1;
break;
- case HYBRID:
- WEIGHTS[0] = 1; WEIGHTS[1] = 0.0033; WEIGHTS[2]
= 0;
- // FIXME: Relative timestamp fix reduces the
absolute
- // value of the timestamp component of the
scoring function
- // to a comparatively much smaller number. W[1]
needs to be
- // re-tuned accordingly.
- // FIXME: Tune hybrid with a ratio of all three.
- // TODO: Automatic tuning of weights.
- break;
}
_cachepolicy = policy;
}