ado-autoconf 1.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. ado_autoconf-1.3.0/.gitignore +31 -0
  2. ado_autoconf-1.3.0/PKG-INFO +13 -0
  3. ado_autoconf-1.3.0/README.md +295 -0
  4. ado_autoconf-1.3.0/autoconf/AutoGluonModels/README.md +49 -0
  5. ado_autoconf-1.3.0/autoconf/AutoGluonModels/changelog.md +30 -0
  6. ado_autoconf-1.3.0/autoconf/AutoGluonModels/v1-1-0_ag-20251112_155927-refit-clone-opt/learner.pkl +0 -0
  7. ado_autoconf-1.3.0/autoconf/AutoGluonModels/v1-1-0_ag-20251112_155927-refit-clone-opt/metadata.json +312 -0
  8. ado_autoconf-1.3.0/autoconf/AutoGluonModels/v1-1-0_ag-20251112_155927-refit-clone-opt/models/NeuralNetTorch_FULL/model.pkl +0 -0
  9. ado_autoconf-1.3.0/autoconf/AutoGluonModels/v1-1-0_ag-20251112_155927-refit-clone-opt/models/WeightedEnsemble_L2_FULL/model.pkl +0 -0
  10. ado_autoconf-1.3.0/autoconf/AutoGluonModels/v1-1-0_ag-20251112_155927-refit-clone-opt/models/trainer.pkl +0 -0
  11. ado_autoconf-1.3.0/autoconf/AutoGluonModels/v1-1-0_ag-20251112_155927-refit-clone-opt/predictor.pkl +0 -0
  12. ado_autoconf-1.3.0/autoconf/AutoGluonModels/v1-1-0_ag-20251112_155927-refit-clone-opt/version.txt +1 -0
  13. ado_autoconf-1.3.0/autoconf/AutoGluonModels/v2-0-0_ag-20251113_154241-refit-clone-opt/learner.pkl +0 -0
  14. ado_autoconf-1.3.0/autoconf/AutoGluonModels/v2-0-0_ag-20251113_154241-refit-clone-opt/metadata.json +312 -0
  15. ado_autoconf-1.3.0/autoconf/AutoGluonModels/v2-0-0_ag-20251113_154241-refit-clone-opt/models/CatBoost_FULL/model.pkl +0 -0
  16. ado_autoconf-1.3.0/autoconf/AutoGluonModels/v2-0-0_ag-20251113_154241-refit-clone-opt/models/NeuralNetTorch_FULL/model.pkl +0 -0
  17. ado_autoconf-1.3.0/autoconf/AutoGluonModels/v2-0-0_ag-20251113_154241-refit-clone-opt/models/WeightedEnsemble_L2_FULL/model.pkl +0 -0
  18. ado_autoconf-1.3.0/autoconf/AutoGluonModels/v2-0-0_ag-20251113_154241-refit-clone-opt/models/XGBoost_FULL/model.pkl +0 -0
  19. ado_autoconf-1.3.0/autoconf/AutoGluonModels/v2-0-0_ag-20251113_154241-refit-clone-opt/models/XGBoost_FULL/xgb.ubj +0 -0
  20. ado_autoconf-1.3.0/autoconf/AutoGluonModels/v2-0-0_ag-20251113_154241-refit-clone-opt/models/trainer.pkl +0 -0
  21. ado_autoconf-1.3.0/autoconf/AutoGluonModels/v2-0-0_ag-20251113_154241-refit-clone-opt/predictor.pkl +0 -0
  22. ado_autoconf-1.3.0/autoconf/AutoGluonModels/v2-0-0_ag-20251113_154241-refit-clone-opt/version.txt +1 -0
  23. ado_autoconf-1.3.0/autoconf/__init__.py +3 -0
  24. ado_autoconf-1.3.0/autoconf/min_gpu_recommender.py +249 -0
  25. ado_autoconf-1.3.0/autoconf/test/__init__.py +3 -0
  26. ado_autoconf-1.3.0/autoconf/test/test_config_mapper.py +50 -0
  27. ado_autoconf-1.3.0/autoconf/test/test_recommender.py +128 -0
  28. ado_autoconf-1.3.0/autoconf/utils/__init__.py +3 -0
  29. ado_autoconf-1.3.0/autoconf/utils/autoconf_build/README.md +71 -0
  30. ado_autoconf-1.3.0/autoconf/utils/autoconf_build/__init__.py +3 -0
  31. ado_autoconf-1.3.0/autoconf/utils/autoconf_build/ml_classifier.py +107 -0
  32. ado_autoconf-1.3.0/autoconf/utils/config_mapper.py +54 -0
  33. ado_autoconf-1.3.0/autoconf/utils/pydantic_models.py +23 -0
  34. ado_autoconf-1.3.0/autoconf/utils/recommender.py +159 -0
  35. ado_autoconf-1.3.0/autoconf/utils/rule_based_classifier.py +60 -0
  36. ado_autoconf-1.3.0/examples/simple.yaml +16 -0
  37. ado_autoconf-1.3.0/examples/sweep/operation.yaml +19 -0
  38. ado_autoconf-1.3.0/examples/sweep/space.yaml +54 -0
  39. ado_autoconf-1.3.0/pyproject.toml +49 -0
@@ -0,0 +1,31 @@
1
+ .*influx_vars*
2
+ .*mysql_vars*
3
+ .DS_Store
4
+ .eggs/
5
+ .vscode/
6
+ .idea/
7
+ *.egg-info/
8
+ build/
9
+ __pycache__/
10
+ # vim
11
+ *.swp
12
+ *.swo
13
+ examples/*/dist/*
14
+ examples/*/build/*
15
+ .run/
16
+ .run
17
+ .actuator_plugin_cache.json*
18
+ .actuator_catalog_cache.json*
19
+ discovery_space*.json
20
+ .log
21
+ dist/*
22
+ plugins/*/dist/*
23
+
24
+ # to be save...
25
+ *_runtime.env.yaml
26
+ *_runtime*.env.yaml
27
+ .env
28
+ .venv
29
+ pytest-sqlite.db
30
+ .tox
31
+ toxenv
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.4
2
+ Name: ado-autoconf
3
+ Version: 1.3.0
4
+ Summary: An AutoConf plugin that suggests the minimum number of gpus necessary to execute a Tuning job
5
+ Requires-Dist: ado-core>=1.2.3
6
+ Requires-Dist: autogluon-tabular[catboost,xgboost]
7
+ Requires-Dist: cloudpickle
8
+ Requires-Dist: fastai
9
+ Requires-Dist: pandas
10
+ Requires-Dist: pydantic
11
+ Requires-Dist: torch
12
+ Provides-Extra: libomp
13
+ Requires-Dist: autogluon-tabular[lightgbm]; extra == 'libomp'
@@ -0,0 +1,295 @@
1
+ # AutoConf
2
+
3
+ This package contains ado custom experiments for use in automated configuration
4
+ of workload resources requirements for GenAI workloads.
5
+
6
+ ## min_gpu_recommender
7
+
8
+ **min_gpu_recommender** is a predictive model that recommends the minimum number
9
+ of GPUs per worker and the number of workers required to run a tuning job
10
+ without triggering a GPU Out Of Memory exception.
11
+
12
+ This model combines rule-based logic with an
13
+ [AutoGluon](https://auto.gluon.ai/stable/index.html) tabular classifier.
14
+
15
+ ### Model Details
16
+
17
+ The model operates on the following features:
18
+
19
+ - `model_name`
20
+ - `method` (e.g., `lora`, `full`)
21
+ - `gpu_model`
22
+ - `tokens_per_sample`
23
+ - `batch_size`
24
+ - `is_valid`
25
+
26
+ and outputs 3 parameters:
27
+
28
+ - `can_recommend` with values [0,1]
29
+ - `workers` with an integer value
30
+ - `gpus` with an integer value
31
+
32
+ The min_gpu_recommender is exposed via an [`ado`](ibm.github.io/ado/)
33
+ [custom experiment](https://ibm.github.io/ado/actuators/creating-custom-experiments/)
34
+ This enables validation of parameters provided for invocation against the domain
35
+ accepted by the recommender model. This ensures that, as expected, the model
36
+ returns `can_recommend==0` for configuration domain values (e.g. model names)
37
+ that were absent in its training set.
38
+
39
+ Please note that the accepted domains of the models are updated with every
40
+ version of the model. Please see
41
+ [models README](autoconf/AutoGluonModels/README.md) for information on the
42
+ different model versions available. Please refer to
43
+ [the changelog](autoconf/AutoGluonModels/changelog.md) for more details on model
44
+ updates
45
+
46
+ ### Installation and Usage
47
+
48
+ Install the package e.g. from the root of the ado repository, run:
49
+
50
+ ```bash
51
+ pip install plugins/custom_experiments/autoconf
52
+ ```
53
+
54
+ The min_gpu_recommender model can be invoked in multiple ways:
55
+
56
+ #### 1. CLI
57
+
58
+ Via ado's `run_experiment` CLI command. Here's an example YAML file (which you
59
+ can find under [examples/simple.yaml](examples/simple.yaml).
60
+
61
+ ```yaml
62
+ entity:
63
+ model_name: llama-7b
64
+ method: lora
65
+ gpu_model: NVIDIA-A100-80GB-PCIe
66
+ tokens_per_sample: 8192
67
+ batch_size: 16
68
+ model_version: 1.1.0
69
+
70
+ experiments:
71
+ - actuatorIdentifier: custom_experiments
72
+ experimentIdentifier: min_gpu_recommender
73
+ ```
74
+
75
+ To use it, from the root directory of ado repository, run
76
+
77
+ ```bash
78
+ run_experiment plugins/custom_experiments/autoconf/examples/simple.yaml
79
+ ```
80
+
81
+ After a few seconds you should see:
82
+
83
+ <!-- markdownlint-disable line-length -->
84
+
85
+ ```bash
86
+ Point: {'model_name': 'llama-7b', 'method': 'lora', 'gpu_model': 'NVIDIA-A100-80GB-PCIe', 'tokens_per_sample': 8192, 'batch_size': 16, 'model_version': '1.1.0'}
87
+ 2025-11-13 13:26:24,925 INFO worker.py:2003 -- Started a local Ray instance. View the dashboard at http://127.0.0.1:8265
88
+ /Users/username/projects/orchestrator/autoconf/.venv/lib/python3.12/site-packages/ray/_private/worker.py:2051: FutureWarning: Tip: In future versions of Ray, Ray will no longer override accelerator visible devices env var if num_gpus=0 or num_gpus=None (default). To enable this behavior and turn off this error message, set RAY_ACCEL_ENV_VAR_OVERRIDE_ON_ZERO=0
89
+ warnings.warn(
90
+ {}
91
+ Validating entity ...
92
+ Executing: custom_experiments.min_gpu_recommender
93
+ (CustomExperiments pid=55466) Found 1 mismatches between original and current metadata:
94
+ (CustomExperiments pid=55466) INFO: AutoGluon Python micro version mismatch (original=3.12.7, current=3.12.11)
95
+ Result:
96
+ [request_id 2df09f
97
+ request_index 0
98
+ entity_index 0
99
+ result_index 0
100
+ batch_size 16
101
+ generatorid unk
102
+ gpu_model NVIDIA-A100-80GB-PCIe
103
+ method lora
104
+ model_name llama-7b
105
+ model_version 1.1.0
106
+ tokens_per_sample 8192
107
+ identifier model_name.llama-7b-method.lora-gpu_model.NVID...
108
+ experiment_id custom_experiments.min_gpu_recommender
109
+ valid True
110
+ can_recommend 1
111
+ gpus 2
112
+ workers 1
113
+ ```
114
+
115
+ <!-- markdownlint-enable line-length -->
116
+
117
+ The output of the experiment are the lines:
118
+
119
+ ```bash
120
+ gpus 2
121
+ workers 1
122
+ can_recommend 1
123
+ ```
124
+
125
+ It reports that the recommender can make a suggestion (`can_recommend=1`). The
126
+ suggestion comes in the form of number of workers and GPUs per worker. In the
127
+ above example, you should use 1 worker with 2 GPUs.
128
+
129
+ #### 2. Example programmatic usage with validation
130
+
131
+ Calling decorated `min_gpu_recommender` custom experiment directly.
132
+
133
+ <!-- markdownlint-disable line-length -->
134
+
135
+ ```python
136
+ from orchestrator.schema.reference import (
137
+ ExperimentReference,
138
+ )
139
+ from orchestrator.schema.point import SpacePoint
140
+ from orchestrator.modules.actuators.registry import ActuatorRegistry
141
+ from autoconf.min_gpu_recommender import (
142
+ min_gpu_recommender,
143
+ )
144
+
145
+ configuration = {
146
+ "model_name": "llama-7b",
147
+ "method": "lora",
148
+ "gpu_model": "NVIDIA-A100-80GB-PCIe",
149
+ "tokens_per_sample": 8192,
150
+ "batch_size": 16,
151
+ "model_version": "1.1.0",
152
+ }
153
+
154
+ measured_properties=min_gpu_recommender(**configuration)
155
+ print(measured_properties)
156
+ ```
157
+
158
+ <!-- markdownlint-enable line-length -->
159
+
160
+ This will print a similar text to:
161
+
162
+ <!-- markdownlint-disable line-length -->
163
+
164
+ ```bash
165
+ Found 1 mismatches between original and current metadata:
166
+ WARNING: AutoGluon Python version mismatch (original=3.12, current=3.10)
167
+ [value-op-min_gpu_recommender-can_recommend:1, value-op-min_gpu_recommender-gpus:2, value-op-min_gpu_recommender-workers:1]
168
+ ```
169
+
170
+ Note: This warning can be safely ignored for now.
171
+
172
+ <!-- markdownlint-enable line-length -->
173
+
174
+ #### 3. Calling `min_gpu_recommender` custom experiment via `ado`
175
+
176
+ This will use ray, the `custom_experiment` actuator and return results in `ado`
177
+ format (MeasurementRequest)
178
+
179
+ <!-- markdownlint-disable line-length -->
180
+
181
+ ```python
182
+ from orchestrator.schema.reference import (
183
+ ExperimentReference,
184
+ )
185
+ from orchestrator.schema.point import SpacePoint
186
+ from orchestrator.modules.actuators.registry import ActuatorRegistry
187
+ from orchestrator.utilities.run_experiment import local_execution_closure
188
+
189
+ configuration = {
190
+ "model_name": "llama-7b",
191
+ "method": "lora",
192
+ "gpu_model": "NVIDIA-A100-80GB-PCIe",
193
+ "tokens_per_sample": 8192,
194
+ "batch_size": 16,
195
+ "model_version": "1.1.0",
196
+ }
197
+
198
+ entity = SpacePoint.model_validate({"entity":configuration}).to_entity()
199
+ experiment = ActuatorRegistry().experimentForReference(
200
+ ExperimentReference(
201
+ actuatorIdentifier="custom_experiments",
202
+ experimentIdentifier="min_gpu_recommender",
203
+ )
204
+ )
205
+
206
+ request=local_execution_closure(registry=ActuatorRegistry())(reference=experiment.reference, entity=entity)
207
+ print(request.measurements[0].series_representation(output_format="target"))
208
+ ```
209
+
210
+ ### Downstream Example: Parameter Sweep over a configuration space
211
+
212
+ <!-- markdownlint-enable line-length -->
213
+
214
+ This example demonstrates the use case where `ado` is used to obtain predictions
215
+ for points in a large configuration space. This avoids the time and resource
216
+ overheads of having to benchmark each point to determine if: a) the
217
+ configuration represented by the point is feasible; and b) the minimum number of
218
+ GPUs required for this configuration.
219
+
220
+ This example uses the space in
221
+ [sweep/examples/space.yaml](sweep/examples/space.yaml) which applies the
222
+ `min_gpu_recommender` experiment on 3960 configurations.
223
+
224
+ The space looks like this:
225
+
226
+ ```yaml
227
+ experiments:
228
+ - experimentIdentifier: min_gpu_recommender
229
+ actuatorIdentifier: custom_experiments
230
+
231
+ entitySpace:
232
+ - identifier: "model_name"
233
+ propertyDomain:
234
+ values:
235
+ [
236
+ "granite-3.1-2b",
237
+ "granite-20b-v2",
238
+ "granite-13b-v2",
239
+ "granite-3-8b",
240
+ "granite-3.1-3b-a800m-instruct",
241
+ "granite-3.1-8b-instruct",
242
+ "granite-34b-code-base",
243
+ "granite-3b-code-base-128k",
244
+ "granite-7b-base",
245
+ "granite-8b-code-base",
246
+ "granite-8b-japanese",
247
+ "llama-13b",
248
+ "llama-7b",
249
+ "llama2-70b",
250
+ "llama3-70b",
251
+ "llama3-8b",
252
+ "llama3.1-405b",
253
+ "llama3.1-70b",
254
+ "llama3.1-8b",
255
+ "mistral-123b-v2",
256
+ "mistral-7b-v0.1",
257
+ "mixtral-8x7b-instruct-v0.1",
258
+ ]
259
+ - identifier: "tokens_per_sample"
260
+ propertyDomain:
261
+ values: [512, 1024, 2048, 4096, 8192]
262
+ - identifier: "batch_size"
263
+ propertyDomain:
264
+ values: [1, 2, 4, 8, 32, 64]
265
+ - identifier: "gpu_model"
266
+ propertyDomain:
267
+ values: ["NVIDIA-A100-SXM4-80GB", "NVIDIA-A100-80GB-PCIe", "L40S"]
268
+ - identifier: method
269
+ propertyDomain:
270
+ values: ["full", "lora"]
271
+ - identifier: model_version
272
+ propertyDomain:
273
+ values:
274
+ - "1.1.0"
275
+ ```
276
+
277
+ To execute this run:
278
+
279
+ <!-- markdownlint-disable line-length -->
280
+
281
+ ```bash
282
+ ado create space -f examples/sweep/space.yaml
283
+ ado create operation -f examples/sweep/operation.yaml --use-latest space
284
+ : The above step will take a few minutes to sweep over the points
285
+ : This command will generate a CSV file with the results
286
+ ado show entities --use-latest space --output-format csv
287
+ open space-*.csv
288
+ ```
289
+
290
+ <!-- markdownlint-enable line-length -->
291
+
292
+ Look for the `can_recommend`, `gpus`, and `workers` columns in the CSV file.
293
+
294
+ Learn more about exploring spaces in the ado documentation for taking a
295
+ [RandomWalk on a space](https://ibm.github.io/ado/examples/random-walk/#exploring-the-discoveryspace).
@@ -0,0 +1,49 @@
1
+ # autoconf Model Information
2
+
3
+ This repository contains the models developed for `autoconf`
4
+
5
+ The current model is trained on ~15500 rows of data stored in
6
+ <https://lake-llm.cash.sl.cloud9.ibm.com/superset/dashboard/136/> (accessed on
7
+ 30th October), achieving approximately 90% accuracy. You can find the models in
8
+ [the directory with this README](./).
9
+
10
+ ## Versioning Information
11
+
12
+ All model subfolders in
13
+ [`autoconf/AutoGluonModels/`](autoconf/AutoGluonModels/)) must follow the naming
14
+ convention: `vX-Y-Z`, where `X`, `Y` and `Z` are integers.
15
+
16
+ - **Major version (X):** Incremented when changes are made to:
17
+
18
+ - **Columns**: Feature set or target variables (e.g., adding/removing
19
+ features, switching to multi-label prediction).
20
+ - **Rows**: Dataset used for training.
21
+
22
+ - **Minor version (Y):** Incremented when changes are made to:
23
+ - **Algorithms**: Modifications that may affect dependencies.
24
+ - **Inference speed**: Performance optimizations.
25
+ - **Model performance**: Improvements in accuracy or other metrics.
26
+ - **Model size**: Significant changes (≥10× difference).
27
+
28
+ > **Note:** Minor version (`Y`) is not incremented if the major version (`X`) is
29
+ > updated.
30
+
31
+ - **Patch version (Z):** Incremented when changes are made to:
32
+ - Parameters for model invocation (see below) are updated independent of model
33
+
34
+ ## Available Versions
35
+
36
+ The current available model versions are:
37
+
38
+ <!-- markdownlint-disable line-length -->
39
+
40
+ | Version | Folder | Comments | Author | Status |
41
+ | ------- | --------------------------------------------------------- | ---------------------------------------------------------------------- | ------- | ---------- |
42
+ | v2.0.0 | AutoGluonModels/v2-0-0_ag-20251113_154241-refit-clone-opt | Trained on Lakehouse data in Nov 2025 (Including `granite-4.0` models) | Daniele | Active |
43
+ | v1.1.0 | AutoGluonModels/v1-1-0_ag-20251112_155927-refit-clone-opt | Removes LightGBM, fixes issues with `libomp` on macOS | Daniele | Active |
44
+ | v1.0.0 | AutoGluonModels/v1-0-0_ag-20251024_100825-refit-clone-opt | Trained on Lakehouse data in Oct 2025 | Daniele | Deprecated |
45
+ | v0.0.0 | AutoGluonModels/v0-0-0_20251024_100825-refit-clone-opt | Trained on Lakehouse data in Sept 2024 | Daniele | Deprecated |
46
+
47
+ <!-- markdownlint-enable line-length -->
48
+
49
+ For more details, read the [changelog](changelog.md)
@@ -0,0 +1,30 @@
1
+ # Model Changelog
2
+
3
+ Please record the following for each model:
4
+
5
+ - Initials of the contributor
6
+ - Subfolder name
7
+ - Date of introduction
8
+ - Summary of changes compared to previous versions
9
+
10
+ ---
11
+
12
+ ## 13/11/2026 Model Update - Binary Classifier v2.0.0
13
+
14
+ **Author : Daniele Lotito** **Changes:**
15
+
16
+ - Trained on updated lakehouse data (includes `granite-4.0` models, data up to
17
+ 30th October 2025).
18
+ - Same dependencies as previous version.
19
+
20
+ **Location : `v2-0-0_ag-20251113_154241-refit-clone-opt`**
21
+
22
+ ## 12/11/2026 Model Update - Binary Classifier v1.1.0
23
+
24
+ **Author: Daniele Lotito** **Changes:**
25
+
26
+ - Removed dependencies on `limbomp` and `fastai`.
27
+ - No changes to model size, datasets, or performance.
28
+ - Requires PyTorch
29
+
30
+ **Location:`v1-1-0_ag-20251112_155927-refit-clone-opt`**