summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2024-03-07 10:28:40 +0100
committerBirte Kristina Friesel <birte.friesel@uos.de>2024-03-07 10:28:40 +0100
commit9754b3a46dad43211539a3dbfbc7c5095bdf30f5 (patch)
tree27ad1d88d18059355cf29dae2d84295763126aac
parent260a5fa322c6910fbc7b046b6f63aef1a636ef92 (diff)
Replace RMT_ENABLED=0 with MODEL=uls
-rw-r--r--README.md3
-rw-r--r--doc/modeling-method.md2
-rw-r--r--lib/model.py7
3 files changed, 6 insertions, 6 deletions
diff --git a/README.md b/README.md
index b83fc21..fcc8eba 100644
--- a/README.md
+++ b/README.md
@@ -112,9 +112,8 @@ The following variables may be set to alter the behaviour of dfatool components.
| `DFATOOL_KCONF_WITH_CHOICE_NODES` | 0, **1** | Treat kconfig choices (e.g. "choice Model → MobileNet / ResNet / Inception") as enum parameters. If enabled, the corresponding boolean kconfig variables (e.g. "Model\_MobileNet") are not converted to parameters. If disabled, all (and only) boolean kconfig variables are treated as parameters. Mostly relevant for analyze-kconfig, eval-kconfig |
| `DFATOOL_COMPENSATE_DRIFT` | **0**, 1 | Perform drift compensation for loaders without sync input (e.g. EnergyTrace or Keysight) |
| `DFATOOL_DRIFT_COMPENSATION_PENALTY` | 0 .. 100 (default: majority vote over several penalties) | Specify penalty for ruptures.py PELT changepoint petection |
-| `DFATOOL_MODEL` | cart, decart, fol, lgbm, lmt, **rmt**, symreg, xgb | Modeling method. See below for method-specific configuration options. |
+| `DFATOOL_MODEL` | cart, decart, fol, lgbm, lmt, **rmt**, symreg, uls, xgb | Modeling method. See below for method-specific configuration options. |
| `DFATOOL_RMT_SUBMODEL` | cart, fol, static, symreg, **uls** | Modeling method for RMT leaf functions. |
-| `DFATOOL_RMT_ENABLED` | 0, **1** | Use decision trees in get\_fitted |
| `DFATOOL_CART_MAX_DEPTH` | **0** .. *n* | maximum depth for sklearn CART. Default (0): unlimited. |
| `DFATOOL_LGBM_BOOSTER` | **gbdt**, dart, rf | Boosting type. |
| `DFATOOL_LGBM_N_ESTIMATORS` | .., **100**, .. | Number of estimators. |
diff --git a/doc/modeling-method.md b/doc/modeling-method.md
index bd0a15d..98d8fcf 100644
--- a/doc/modeling-method.md
+++ b/doc/modeling-method.md
@@ -60,7 +60,7 @@ You should also specify `DFATOOL_XGB_N_ESTIMATORS`, `DFATOOL_XGB_MAX_DEPTH`, and
## Least-Squares Regression
-If dfatool determines that there is no need for a tree structure, or if `DFATOOL_RMT_ENABLED=0` has beenset, it will go straight to least-squares regression.
+If dfatool determines that there is no need for a tree structure, or if `DFATOOL_MODEL=uls`, it will go straight to least-squares regression.
By default, it still utilizes the RMT/ULS algorithms to find and fit a suitable function template.
If needed, `--function-override` can be used to set a function template manually.
For instance, in order to specify that NMC DPU allocation latency is a function of the number of DPUs (and nothing else), ue `--function-override 'NMC reconfiguration:latency_dpu_alloc_us:regression_arg(0) + regression_arg(1) * parameter(n_dpus)'`
diff --git a/lib/model.py b/lib/model.py
index 5770218..2452af7 100644
--- a/lib/model.py
+++ b/lib/model.py
@@ -300,7 +300,7 @@ class AnalyticModel:
model_type = os.getenv("DFATOOL_MODEL", "rmt")
- if model_type != "rmt":
+ if model_type != "rmt" and model_type != "uls":
for name in self.names:
for attr in self.by_name[name]["attributes"]:
if model_type == "cart":
@@ -319,7 +319,7 @@ class AnalyticModel:
self.attr_by_name[name][attr].build_xgb()
else:
logger.error(f"build_fitted: unknown model type: {model_type}")
- elif self.force_tree:
+ elif model_type == "rmt" and self.force_tree:
for name in self.names:
for attr in self.by_name[name]["attributes"]:
if (
@@ -337,8 +337,9 @@ class AnalyticModel:
threshold=threshold,
)
else:
+ # model_type == "rmt" and not self.force_tree or model_type == "uls"
paramfit = ParamFit()
- tree_allowed = bool(int(os.getenv("DFATOOL_RMT_ENABLED", "1")))
+ tree_allowed = model_type == "rmt"
tree_required = dict()
for name in self.names: