Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6d67ae1
add docstrings on Environment Parameterization and Variable Propagation
motus Mar 12, 2025
37cc18b
fix formatting issues
motus Mar 12, 2025
2b99791
Merge branch 'main' into sergiym/doc/var_propagation
motus Mar 12, 2025
eea4aeb
minor docstring improvements
motus Mar 12, 2025
0a4d050
minor docstring fixes
motus Mar 12, 2025
ccda090
crossref resolution fixups
bpkroth Mar 13, 2025
9f8826f
add another crossref link
bpkroth Mar 13, 2025
1972c16
Add some comments regarding tunables_params_map
bpkroth Mar 13, 2025
cf5e1f9
reformatting and restructuring
bpkroth Mar 13, 2025
e6d83f8
fixups
bpkroth Mar 13, 2025
3b00618
rst syntax instead of markdown
bpkroth Mar 13, 2025
aad0381
more cross refs
bpkroth Mar 13, 2025
397c6ee
tweaks
bpkroth Mar 13, 2025
cb58885
tweaks
bpkroth Mar 13, 2025
eb31797
incorrect and incomplete example
bpkroth Mar 13, 2025
f15cb6d
link fixup
bpkroth Mar 13, 2025
2d062a2
cross ref
bpkroth Mar 13, 2025
8b69130
fixups
bpkroth Mar 13, 2025
1ace927
fixups
bpkroth Mar 13, 2025
55faf60
fixup for service=None
bpkroth Mar 13, 2025
8dd9ac4
wip more examples
bpkroth Mar 13, 2025
16ccf9e
tweaks
bpkroth Mar 13, 2025
b5d7798
wip: more docs
bpkroth Mar 14, 2025
514e11c
wip
bpkroth Mar 14, 2025
bc4043c
add a section documenting the tunable_params_map
motus Mar 17, 2025
27fa353
a simpler version of the variable propagation example (WIP)
motus Mar 18, 2025
9d7f491
fixing the executable examples in the environments docstrings (WIP)
motus Mar 18, 2025
e27fdd2
first complete version of the variable propagation example.
motus Mar 18, 2025
bbbe0b9
make docstring tests pass
motus Mar 18, 2025
ff89593
trying to please pydocstyle
motus Mar 18, 2025
393e038
remove blank lines after Examples, Notes, and See Also sections to pl…
motus Mar 18, 2025
eecabf9
fix a few links
bpkroth Mar 20, 2025
475189e
Add a rule to look for malformed RST links
bpkroth Mar 20, 2025
cf31fec
update the Environment docstring explaining the `.parameters` property
motus Mar 20, 2025
1f31ca0
Update mlos_bench/mlos_bench/environments/__init__.py
motus Mar 20, 2025
308dff5
merge in PR suggestions from Brian
motus Mar 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,8 @@ build/check-doc.build-stamp: doc/build/html/index.html doc/build/html/htmlcov/in
test -s doc/build/html/autoapi/mlos_viz/index.html
test -s doc/build/html/autoapi/mlos_viz/dabl/index.html
grep -q -e '--config CONFIG' doc/build/html//mlos_bench.run.usage.html
# Look for malformed rst links: `LinkName <LinkTarget>`_
if find doc/build/html -name '*.html' -print0 | xargs -0 grep -m1 '&gt;`_' | grep -m1 .; then echo "Bad links found"; false; fi
# Check doc logs for errors (but skip over some known ones) ...
@cat doc/build/log.txt \
| egrep -C1 -e WARNING -e CRITICAL -e ERROR \
Expand Down
42 changes: 40 additions & 2 deletions mlos_bench/mlos_bench/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,40 @@
"current_dir": "$PWD",
"some_expanded_var": "$some_var: $experiment_id",
"location": "eastus",
// This can be specified in the CLI config or the globals config
"tunable_params_map": {
// a map of tunable_params variables to their covariant group names
"environment1_tunables": [
"covariant_group_name",
"another_covariant_group_name"
],
"environment2_tunables": [
// empty list means no tunables
// are enabled for this environment
// during this experiment
// (e.g., only use defaults for this environment)
],
}
There are additional details about variable propagation in the
Users can have multiple global config files, each specified with a ``--globals``
CLI arg or ``"globals"`` CLI config property.
At runtime, parameters from these files will be combined into a single
dictionary, in the order they appear, and pushed to the root
:py:class:`Environment <mlos_bench.environments>`.
Any global or :py:class:`~.Environment` parameter can also be overridden from
the command line, by simply specifying ``--PARAMETER_NAME PARAMETER_VALUE``.
Another common use of global config files is to store sensitive data (e.g.,
passwords, tokens, etc.) that should not be version-controlled.
This way, users can keep their experiment-specific parameters separately from
the Environment configs making them more reusable.
There are additional details about `Variable Propagation
<../environments/index.html#variable-propagation>`_ in the
:py:mod:`mlos_bench.environments` module.
Well Known Variables
Expand All @@ -216,6 +247,13 @@
- ``$trial_runner_id``: A unique identifier for the ``TrialRunner``.
This can be useful when running multiple trials in parallel (e.g., to
provision a numbered VM per worker).
- ``$tunable_params_map``: A map of ``tunable_params`` ``$name`` to their list of covariant group names.
This is usually used in a CLI ``--config`` CLI config or ``--globals``
(e.g., "experiment") config file and is used to control what the
``"tunable_params": $tunable_group_name`` specified in the the
:py:mod:`mlos_bench.environments` JSONC configs resolves to.
This can be used to control which tunables are enabled for tuning for an
experiment without having to change the underlying Environment config.
Tunable Configs
^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -353,4 +391,4 @@
`mlos_bench/tests/config/README.md
<https://github.com/microsoft/MLOS/tree/main/mlos_bench/mlos_bench/tests/config/>`_
for additional documentation and examples in the source tree.
"""
""" # pylint: disable=line-too-long # noqa: E501
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"config": {
// FIXME: There aren't currently any tunable params for the network environment.
// But one is required to workaround a bug (#613) in the config storage layer.
"tunable_params": ["dummy_params"],
"tunable_params": ["dummy_params_group1"],

// Typically don't want to deprovision the network environment on teardown
// since other experiments in this same RG might be using it.
Expand Down
32 changes: 31 additions & 1 deletion mlos_bench/mlos_bench/config/tunables/dummy-tunables.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// FIXME: A workaround to a bug (#613) in the config system that requires non-empty configs.
{
"dummy_params": {
"dummy_params_group1": {
"cost": 0,
"description": "Dummy parameter group to allow a non-empty config for testing creating singleton resources that have no tunable params.",
"params": {
Expand All @@ -11,5 +11,35 @@
"default": "dummy"
}
}
},
"dummy_params_group2": {
"cost": 1,
"description": "Dummy parameter group for testing",
"params": {
"dummy_param_int": {
"description": "An integer dummy parameter.",
"type": "int",
"range": [0, 100],
"default": 0
},
"dummy_param_float": {
"description": "A float dummy parameter.",
"type": "float",
"range": [0, 1],
"default": 0.5
}
}
},
"dummy_params_group3": {
"cost": 1,
"description": "Another dummy parameter group for testing",
"params": {
"dummy_param3": {
"description": "One more dummy parameter.",
"type": "float",
"range": [-1, 1],
"default": 0.0
}
}
}
}
Loading
Loading