[MINOR] Update default lineage cache eviction policy to COSTNSIZE
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 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 @@
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 @@
//-------------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 @@
LRU,
COSTNSIZE,
DAGHEIGHT,
- HYBRID;
}
protected static Comparator<LineageCacheEntry> LineageCacheComparator = (e1, e2) -> {
@@ -158,9 +157,6 @@
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 @@
//setup static configuration parameters
REUSE_OPCODES = OPCODES;
setSpill(true);
- setCachePolicy(LineageCachePolicy.HYBRID);
+ setCachePolicy(LineageCachePolicy.COSTNSIZE);
setCompAssRW(true);
}
@@ -271,6 +267,7 @@
}
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 @@
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;
}