Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow loading configs from JSON strings and test with new docstrings for tunables #890

Merged
merged 31 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
4b868d7
basic stub for allowing loading configs as json strings for docstring…
bpkroth Dec 4, 2024
3a9ad14
docstring fixups
bpkroth Dec 5, 2024
66085f5
add a todo comment
bpkroth Dec 5, 2024
6ac6949
add docstrings about tunables
bpkroth Dec 5, 2024
92769e3
formatting
bpkroth Dec 5, 2024
10449af
fixup
bpkroth Dec 5, 2024
11ccd5c
add an explicit unit test
bpkroth Dec 5, 2024
5bf9209
format
bpkroth Dec 5, 2024
cb15986
unused import
bpkroth Dec 5, 2024
b5fd716
tweaks
bpkroth Dec 5, 2024
e9e2159
Merge branch 'main' into testable-docstring-configs
bpkroth Dec 5, 2024
eccac69
add more back references
bpkroth Dec 5, 2024
61c27c7
tweaks
bpkroth Dec 5, 2024
4321512
fixup
bpkroth Dec 5, 2024
5e10e3c
format
bpkroth Dec 5, 2024
979fc53
comments
bpkroth Dec 5, 2024
2bd3873
format
bpkroth Dec 5, 2024
89a3ed7
spelling
bpkroth Dec 6, 2024
c795040
add better error handling output and tests for it
bpkroth Dec 6, 2024
bf9abdd
fix docstring
bpkroth Dec 6, 2024
e5d896b
tweaks
bpkroth Dec 6, 2024
7119551
comments
bpkroth Dec 6, 2024
6ec1f16
Also add storage config testing
bpkroth Dec 6, 2024
fd880eb
show an example with a tunable config too
bpkroth Dec 6, 2024
22b1e70
include example of fetching the config data too
bpkroth Dec 6, 2024
f312956
docstring
bpkroth Dec 6, 2024
6f2d113
make sure the provided input is a string, and not an array
bpkroth Dec 6, 2024
52e6d4a
format
bpkroth Dec 6, 2024
60ac3b4
back references
bpkroth Dec 6, 2024
f379063
fixup
bpkroth Dec 6, 2024
8c46888
pylint
bpkroth Dec 6, 2024
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
11 changes: 7 additions & 4 deletions mlos_bench/mlos_bench/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
- ``environments/``:
Contains the configs for :py:mod:`~mlos_bench.environments`, and their
associated scripts (if relevant, e.g., for
`:py:class:`~mlos_bench.environments.remote_env.RemoteEnv` or
:py:class:`~mlos_bench.environments.remote.remote_env.RemoteEnv` or
:py:class:`~mlos_bench.environments.script_env.ScriptEnv`) and
:py:mod:`~mlos_bench.tunables`.

Expand Down Expand Up @@ -253,9 +253,9 @@
],
}

Since TunableParams are associated with Environments, they are typically kept
in the same directory as that environment and named something like
``env-tunables.json``.
Since TunableParams are associated with an :py:mod:`~mlos_bench.environments`,
they are typically kept in the same directory as that Environment's config and
named something like ``env-tunables.json``.

- "TunableValues" style configs which are used to specify the values for an
instantiation of a set of tunables params.
Expand All @@ -276,6 +276,9 @@
:py:class:`~mlos_bench.optimizers.manual_optimizer.ManualOptimizer` to run a
benchmark with a particular config or set of configs.

For more information on tunable configs, see the :py:mod:`mlos_bench.tunables`
module.

Class Configs
^^^^^^^^^^^^^

Expand Down
8 changes: 8 additions & 0 deletions mlos_bench/mlos_bench/environments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@
- See `mlos_bench/config/environments/README.md
<https://github.com/microsoft/MLOS/tree/main/mlos_bench/mlos_bench/config/environments/>`_
for additional config examples in the source tree.

See Also
--------
:py:mod:`mlos_bench.config` : Overview of the configuration system.
:py:mod:`mlos_bench.services` : Overview of the Services available to the
Environments and their configurations.
:py:mod:`mlos_bench.tunables` : Overview of the Tunables available to the
Environments and their configurations.
"""

from mlos_bench.environments.base_environment import Environment
Expand Down
1 change: 1 addition & 0 deletions mlos_bench/mlos_bench/environments/base_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def __init__( # pylint: disable=too-many-arguments
)
tunables = TunableGroups()

# TODO: add user docstrings for these in the module
groups = self._expand_groups(
config.get("tunable_params", []),
(global_config or {}).get("tunable_params_map", {}),
Expand Down
Loading
Loading