diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-02-21 12:57:08 +0100 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-02-21 12:57:08 +0100 |
commit | 10a3b0db4d6541baf4caebef555977c17086012a (patch) | |
tree | 792672dd426f6b49390b6716e3d3aa85f65e1c75 | |
parent | b55023fda36ec320be4f7cd41ec83a9914a5d165 (diff) |
Rename DFATOOL_DTREE_* to DFATOOL_RMT_*
-rw-r--r-- | .gitlab-ci.yml | 4 | ||||
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | doc/modeling-method.md | 6 | ||||
-rwxr-xr-x | examples/explore-and-model-static | 8 | ||||
-rw-r--r-- | lib/model.py | 2 | ||||
-rw-r--r-- | lib/parameters.py | 12 |
6 files changed, 21 insertions, 21 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1718a4f..149653d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -55,11 +55,11 @@ make_model: script: - mkdir -p models - wget -q https://ess.cs.uos.de/.private/dfatool/multipass.json.xz https://ess.cs.uos.de/.private/dfatool/multipass.kconfig - - DFATOOL_DTREE_IGNORE_IRRELEVANT_PARAMS=0 bin/analyze-kconfig.py multipass.kconfig multipass.json.xz --export-webconf models/multipass-rmt.json + - DFATOOL_RMT_IGNORE_IRRELEVANT_PARAMS=0 bin/analyze-kconfig.py multipass.kconfig multipass.json.xz --export-webconf models/multipass-rmt.json - wget -q https://ess.cs.uos.de/.private/dfatool/x264.json.xz https://ess.cs.uos.de/.private/dfatool/x264.kconfig https://ess.cs.uos.de/.private/dfatool/x264.nfpkeys.json - mv x264.nfpkeys.json nfpkeys.json - DFATOOL_MODEL=cart DFATOOL_PARAM_CATEGORICAL_TO_SCALAR=1 bin/analyze-kconfig.py x264.kconfig x264.json.xz --export-webconf models/x264-cart.json - - DFATOOL_DTREE_IGNORE_IRRELEVANT_PARAMS=0 bin/analyze-kconfig.py x264.kconfig x264.json.xz --export-webconf models/x264-rmt.json + - DFATOOL_RMT_IGNORE_IRRELEVANT_PARAMS=0 bin/analyze-kconfig.py x264.kconfig x264.json.xz --export-webconf models/x264-rmt.json artifacts: paths: - models @@ -112,8 +112,8 @@ The following variables may be set to alter the behaviour of dfatool components. | `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, lmt, **rmt**, xgb | Modeling method. See below for method-specific configuration options. | -| `DFATOOL_DTREE_ENABLED` | 0, **1** | Use decision trees in get\_fitted | -| `DFATOOL_DTREE_FUNCTION_LEAVES` | 0, **1** | Use functions (fitted via linear regression) in decision tree leaves when modeling numeric parameters with at least three distinct values. If 0, integer parameters are treated as enums instead. | +| `DFATOOL_RMT_ENABLED` | 0, **1** | Use decision trees in get\_fitted | +| `DFATOOL_RMT_FUNCTION_LEAVES` | 0, **1** | Use functions (fitted via linear regression) in decision tree leaves when modeling numeric parameters with at least three distinct values. If 0, integer parameters are treated as enums instead. | | `DFATOOL_CART_MAX_DEPTH` | **0** .. *n* | maximum depth for sklearn CART. Default (0): unlimited. | | `DFATOOL_LMT_MAX_DEPTH` | **5** .. 20 | Maximum depth for LMT. | | `DFATOOL_LMT_MIN_SAMPLES_SPLIT` | 0.0 .. 1.0, **6** .. *n* | Minimum samples required to still perform an LMT split. A value below 1.0 sets the specified ratio of the total number of training samples as minimum. | @@ -135,10 +135,10 @@ The following variables may be set to alter the behaviour of dfatool components. | `DFATOOL_KCONF_IGNORE_STRING` | 0, **1** | Ignore string configuration options. These often hold compiler paths and other not really helpful information. | | `DFATOOL_FIT_LINEAR_ONLY` | **0**, 1 | Only consider linear functions (a + bx) in regression analysis. Useful for comparison with Linear Model Trees / M5. | | `DFATOOL_REGRESSION_SAFE_FUNCTIONS` | **0**, 1 | Use safe functions only (e.g. 1/x returnning 1 for x==0) | -| `DFATOOL_DTREE_NONBINARY_NODES` | 0, **1** | Enable non-binary nodes (i.e., nodes with more than two children corresponding to enum variables) in decision trees | -| `DFATOOL_DTREE_IGNORE_IRRELEVANT_PARAMS` | **0**, 1 | Ignore parameters deemed irrelevant by stddev heuristic during regression tree generation. Use with caution. | +| `DFATOOL_RMT_NONBINARY_NODES` | 0, **1** | Enable non-binary nodes (i.e., nodes with more than two children corresponding to enum variables) in decision trees | +| `DFATOOL_RMT_IGNORE_IRRELEVANT_PARAMS` | **0**, 1 | Ignore parameters deemed irrelevant by stddev heuristic during regression tree generation. Use with caution. | | `DFATOOL_PARAM_RELEVANCE_THRESHOLD` | 0 .. **0.5** .. 1 | Threshold for relevant parameter detection: parameter *i* is relevant if mean standard deviation (data partitioned by all parameters) / mean standard deviation (data partition by all parameters but *i*) is less than threshold | -| `DFATOOL_DTREE_LOSS_IGNORE_SCALAR` | **0**, 1 | Ignore scalar parameters when computing the loss for split node candidates. Instead of computing the loss of a single partition for each `x_i == j`, compute the loss of partitions for `x_i == j` in which non-scalar parameters vary and scalar parameters are constant. This way, scalar parameters do not affect the decision about which non-scalar parameter to use for splitting. | +| `DFATOOL_RMT_LOSS_IGNORE_SCALAR` | **0**, 1 | Ignore scalar parameters when computing the loss for split node candidates. Instead of computing the loss of a single partition for each `x_i == j`, compute the loss of partitions for `x_i == j` in which non-scalar parameters vary and scalar parameters are constant. This way, scalar parameters do not affect the decision about which non-scalar parameter to use for splitting. | | `DFATOOL_PARAM_CATEGORICAL_TO_SCALAR` | **0**, 1 | Some models (e.g. FOL, sklearn CART, XGBoost) do not support categorical parameters. Ignore them (0) or convert them to scalar indexes (1). Conversion uses lexical order. | | `DFATOOL_FOL_SECOND_ORDER` | **0**, 1 | Add second-order components (interaction of feature pairs) to first-order linear function. | diff --git a/doc/modeling-method.md b/doc/modeling-method.md index 7a4c635..057f7ee 100644 --- a/doc/modeling-method.md +++ b/doc/modeling-method.md @@ -43,8 +43,8 @@ All of these are valid regression model trees. ### Related Options * `--force-tree` builds a tree structure even if dfatool's heuristic indicates that no non-integer parameter affects the modeled performance attribute. -* `DFATOOL_DTREE_IGNORE_IRRELEVANT_PARAMS=0` disables the relevant parameter detection heuristic when building the tree structure. By default, irrelevant parameters cannot end up as decision nodes. -* `DFATOOL_FIT_LINEAR_ONLY=1` makes RMT behave more like LMT by only considering linear functions in leaf nodes. +* `DFATOOL_RMT_IGNORE_IRRELEVANT_PARAMS=0` disables the relevant parameter detection heuristic when building the tree structure. By default, irrelevant parameters cannot end up as decision nodes. +* `DFATOOL_SUBMODEL=fol` makes RMT only consider linear functions (a + bx) in regression analysis. Useful for comparison with LMT / M5. * `DFATOOL_PARAM_CATEGORICAL_TO_SCALAR=1` * `DFATOOL_ULS_SKIP_CODEPENDENT_CHECK=1` * `DFATOOL_REGRESSION_SAFE_FUNCTIONS=1` @@ -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_DTREE_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_RMT_ENABLED=0` has beenset, 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/examples/explore-and-model-static b/examples/explore-and-model-static index 74c6359..b951b1d 100755 --- a/examples/explore-and-model-static +++ b/examples/explore-and-model-static @@ -12,13 +12,13 @@ set -ex ../bin/explore-kconfig.py --log-level debug --random 10 --with-neighbourhood ../examples/kconfig-static # Each of the following lines generates a single model -DFATOOL_DTREE_IGNORE_IRRELEVANT_PARAMS=0 DFATOOL_KCONF_WITH_CHOICE_NODES=0 ../bin/analyze-kconfig.py --export-webconf ../models/example-static-rmt-b.json --export-raw-predictions ../models/example-static-rmt-b-eval.json ../examples/kconfig-static/Kconfig . -DFATOOL_DTREE_IGNORE_IRRELEVANT_PARAMS=0 DFATOOL_KCONF_WITH_CHOICE_NODES=1 ../bin/analyze-kconfig.py --export-webconf ../models/example-static-rmt-nb.json --export-raw-predictions ../models/example-static-rmt-nb-eval.json ../examples/kconfig-static/Kconfig . +DFATOOL_RMT_IGNORE_IRRELEVANT_PARAMS=0 DFATOOL_KCONF_WITH_CHOICE_NODES=0 ../bin/analyze-kconfig.py --export-webconf ../models/example-static-rmt-b.json --export-raw-predictions ../models/example-static-rmt-b-eval.json ../examples/kconfig-static/Kconfig . +DFATOOL_RMT_IGNORE_IRRELEVANT_PARAMS=0 DFATOOL_KCONF_WITH_CHOICE_NODES=1 ../bin/analyze-kconfig.py --export-webconf ../models/example-static-rmt-nb.json --export-raw-predictions ../models/example-static-rmt-nb-eval.json ../examples/kconfig-static/Kconfig . DFATOOL_MODEL=cart DFATOOL_PARAM_CATEGORICAL_TO_SCALAR=1 DFATOOL_KCONF_WITH_CHOICE_NODES=0 ../bin/analyze-kconfig.py --export-webconf ../models/example-static-cart-b.json --export-raw-predictions ../models/example-static-cart-b-eval.json ../examples/kconfig-static/Kconfig . DFATOOL_MODEL=cart DFATOOL_PARAM_CATEGORICAL_TO_SCALAR=1 DFATOOL_KCONF_WITH_CHOICE_NODES=1 ../bin/analyze-kconfig.py --export-webconf ../models/example-static-cart-nb.json --export-raw-predictions ../models/example-static-cart-nb-eval.json ../examples/kconfig-static/Kconfig . -DFATOOL_DTREE_IGNORE_IRRELEVANT_PARAMS=0 DFATOOL_PARAM_CATEGORICAL_TO_SCALAR=1 DFATOOL_FIT_FOL=1 DFATOOL_KCONF_WITH_CHOICE_NODES=0 ../bin/analyze-kconfig.py --export-webconf ../models/example-static-fol-b.json --export-raw-predictions ../models/example-static-fol-b-eval.json ../examples/kconfig-static/Kconfig . -DFATOOL_DTREE_IGNORE_IRRELEVANT_PARAMS=0 DFATOOL_PARAM_CATEGORICAL_TO_SCALAR=1 DFATOOL_FIT_FOL=1 DFATOOL_KCONF_WITH_CHOICE_NODES=1 ../bin/analyze-kconfig.py --export-webconf ../models/example-static-fol-nb.json --export-raw-predictions ../models/example-static-fol-nb-eval.json ../examples/kconfig-static/Kconfig . +DFATOOL_RMT_IGNORE_IRRELEVANT_PARAMS=0 DFATOOL_PARAM_CATEGORICAL_TO_SCALAR=1 DFATOOL_FIT_FOL=1 DFATOOL_KCONF_WITH_CHOICE_NODES=0 ../bin/analyze-kconfig.py --export-webconf ../models/example-static-fol-b.json --export-raw-predictions ../models/example-static-fol-b-eval.json ../examples/kconfig-static/Kconfig . +DFATOOL_RMT_IGNORE_IRRELEVANT_PARAMS=0 DFATOOL_PARAM_CATEGORICAL_TO_SCALAR=1 DFATOOL_FIT_FOL=1 DFATOOL_KCONF_WITH_CHOICE_NODES=1 ../bin/analyze-kconfig.py --export-webconf ../models/example-static-fol-nb.json --export-raw-predictions ../models/example-static-fol-nb-eval.json ../examples/kconfig-static/Kconfig . cp ../examples/kconfig-static/Kconfig ../models/example-static.kconfig diff --git a/lib/model.py b/lib/model.py index 715ccb1..3d3e45d 100644 --- a/lib/model.py +++ b/lib/model.py @@ -331,7 +331,7 @@ class AnalyticModel: ) else: paramfit = ParamFit() - tree_allowed = bool(int(os.getenv("DFATOOL_DTREE_ENABLED", "1"))) + tree_allowed = bool(int(os.getenv("DFATOOL_RMT_ENABLED", "1"))) use_symreg = bool(int(os.getenv("DFATOOL_FIT_SYMREG", "0"))) tree_required = dict() diff --git a/lib/parameters.py b/lib/parameters.py index e4499ce..390420e 100644 --- a/lib/parameters.py +++ b/lib/parameters.py @@ -832,7 +832,7 @@ class ModelAttribute: def build_symreg_model(self): ignore_irrelevant = bool( - int(os.getenv("DFATOOL_DTREE_IGNORE_IRRELEVANT_PARAMS", "0")) + int(os.getenv("DFATOOL_RMT_IGNORE_IRRELEVANT_PARAMS", "0")) ) ignore_param_indexes = list() if ignore_irrelevant: @@ -936,7 +936,7 @@ class ModelAttribute: def build_fol(self): ignore_irrelevant = bool( - int(os.getenv("DFATOOL_DTREE_IGNORE_IRRELEVANT_PARAMS", "0")) + int(os.getenv("DFATOOL_RMT_IGNORE_IRRELEVANT_PARAMS", "0")) ) ignore_param_indexes = list() if ignore_irrelevant: @@ -1028,21 +1028,21 @@ class ModelAttribute: if with_function_leaves is None: with_function_leaves = bool( - int(os.getenv("DFATOOL_DTREE_FUNCTION_LEAVES", "1")) + int(os.getenv("DFATOOL_RMT_FUNCTION_LEAVES", "1")) ) if with_nonbinary_nodes is None: with_nonbinary_nodes = bool( - int(os.getenv("DFATOOL_DTREE_NONBINARY_NODES", "1")) + int(os.getenv("DFATOOL_RMT_NONBINARY_NODES", "1")) ) if with_gplearn_symreg is None: with_gplearn_symreg = bool(int(os.getenv("DFATOOL_USE_SYMREG", "0"))) if ignore_irrelevant_parameters is None: ignore_irrelevant_parameters = bool( - int(os.getenv("DFATOOL_DTREE_IGNORE_IRRELEVANT_PARAMS", "0")) + int(os.getenv("DFATOOL_RMT_IGNORE_IRRELEVANT_PARAMS", "0")) ) if loss_ignore_scalar is None: loss_ignore_scalar = bool( - int(os.getenv("DFATOOL_DTREE_LOSS_IGNORE_SCALAR", "0")) + int(os.getenv("DFATOOL_RMT_LOSS_IGNORE_SCALAR", "0")) ) if loss_ignore_scalar and not with_function_leaves: |