This repo is a barebones template for a developer environment with some basic scripts and configs to help do autotuning for a new target using MLOS.
-
Fork this repository, or "Use Template" (preferred).
-
Open the new repository in VSCode.
-
Reopen in a devcontainer.
For additional dev environment details, see the devcontainer README.md
-
Reopen the workspace.
- Browse to the
mlos-autouning.code-workspacefile and follow the prompt in the lower right to reopen.
- Browse to the
-
Add some configs and script to the
config/tree.- At a minimum you'll need to define some
Environments, typically with a top-levelCompositeEnvironmentto represent your target system and itsTunablesand include someServicesto help execute your workloads. - See
mlos_bench/README.mdandmlos_bench/config/README.mdfor additional details.
- At a minimum you'll need to define some
-
Activate the conda environment in the integrated terminal:
conda activate mlos
-
Login to the Azure CLI:
az login
-
Stash some relevant auth info (e.g., subscription ID, resource group, etc.):
./MLOS/scripts/generate-azure-credentials-config.sh > global_azure_config.json -
Run the
mlos_benchtool.For instance, to run the Redis example from the upstream MLOS repo (which is pulled locally automatically by the devcontainer startup scripts):
mlos_bench --config "./MLOS/mlos_bench/mlos_bench/config/cli/azure-redis-opt.jsonc" --globals "./MLOS/mlos_bench/mlos_bench/config/experiments/experiment_RedisBench.jsonc" --max_iterations 10
This should take a few minutes to run and does the following:
-
Loads the CLI config.
-
The "experiment" config specified by the
--globalsparameter further customizes that config with the experiment specific parameters (e.g., telling it which tunable parameters to use for the experiment, the experiment name, etc.).Alternatively, other config files from the
config/experiments/directory can be referenced with the--globalsargument as well in order to customize the experiment, while keeping the core other configs the same.
-
-
The CLI config also references and loads the root Environment config for Redis.
- In that config the
setupsection lists commands used to- Prepare a config for the
redisinstance based on the tunable parameters specified in the experiment config,
- Prepare a config for the
- Next, the
runsection lists commands used to- Runs a basic
redis-benchmarkto exercise the instance. - assemble the results into a file that is read in the
read_results_fileconfig section in order to store them into themlos_benchresults database.
- Runs a basic
- Finally, since their is an optimizer specified, this process repeats 10 times to sample several different config points.
- In that config the
The overall process looks like this:
Source: LlamaTune: VLDB 2022
-
- MLOS - the main repo for the
mlos_benchtool. - config tree descriptions