mlos_bench.environments.local.local_fileshare_env module

Scheduler-side Environment to run scripts locally and upload/download data to the shared storage.

class mlos_bench.environments.local.local_fileshare_env.LocalFileShareEnv(*, name: str, config: dict, global_config: dict | None = None, tunables: TunableGroups | None = None, service: Service | None = None)

Bases: LocalEnv

Scheduler-side Environment that runs scripts locally and uploads/downloads data to the shared file storage.

Attributes:
parameters

Key/value pairs of all environment parameters (i.e., const_args and tunable_params).

tunable_params

Get the configuration space of the given environment.

Methods

new(*, env_name, class_name, config[, ...])

Factory method for a new environment with a given config.

pprint([indent, level])

Pretty-print the environment configuration.

run()

Download benchmark results from the shared storage and run post-processing scripts locally.

setup(tunables[, global_config])

Run setup scripts locally and upload the scripts and data to the shared storage.

status()

Check the status of the benchmark environment.

teardown()

Clean up the local environment.

run() Tuple[Status, datetime, Dict[str, int | float | str | None] | None]

Download benchmark results from the shared storage and run post-processing scripts locally.

Returns:
(status, timestamp, output)(Status, datetime, dict)

3-tuple of (Status, timestamp, output) values, where output is a dict with the results or None if the status is not COMPLETED. If run script is a benchmark, then the score is usually expected to be in the score field.

setup(tunables: TunableGroups, global_config: dict | None = None) bool

Run setup scripts locally and upload the scripts and data to the shared storage.

Parameters:
tunablesTunableGroups

A collection of tunable OS and application parameters along with their values. In a local environment these could be used to prepare a config file on the scheduler prior to transferring it to the remote environment, for instance.

global_configdict

Free-format dictionary of global parameters of the environment that are not used in the optimization process.

Returns:
is_successbool

True if operation is successful, false otherwise.

status() Tuple[Status, datetime, List[Tuple[datetime, str, Any]]]

Check the status of the benchmark environment.

Returns:
(benchmark_status, timestamp, telemetry)(Status, datetime, list)

3-tuple of (benchmark status, timestamp, telemetry) values. timestamp is UTC time stamp of the status; it’s current time by default. telemetry is a list (maybe empty) of (timestamp, metric, value) triplets.