Abstract serial runner
smac.runner.abstract_serial_runner
#
AbstractSerialRunner
#
Bases: AbstractRunner
Source code in smac/runner/abstract_runner.py
run
abstractmethod
#
run(
config: Configuration,
instance: str | None = None,
budget: float | None = None,
seed: int | None = None,
additional_info: dict[str, Any] | None = None,
) -> tuple[
StatusType,
float | list[float],
float,
float,
dict[str, Any],
]
Runs the target function with a configuration on a single instance-budget-seed combination (aka trial).
| PARAMETER | DESCRIPTION |
|---|---|
config
|
Configuration to be passed to the target function.
TYPE:
|
instance
|
The Problem instance.
TYPE:
|
budget
|
A positive, real-valued number representing an arbitrary limit to the target function handled by the target function internally.
TYPE:
|
seed
|
Seed for the random number generator.
TYPE:
|
additional_info
|
Further additional trial information.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
status
|
Status of the trial.
TYPE:
|
cost
|
Resulting cost(s) of the trial. |
runtime
|
The time the target function took to run.
TYPE:
|
cpu_time
|
The time the target function took on hardware to run.
TYPE:
|
val_additional_info
|
All further additional trial value information.
TYPE:
|
Source code in smac/runner/abstract_runner.py
run_wrapper
#
run_wrapper(
trial_info: TrialInfo,
**dask_data_to_scatter: dict[str, Any]
) -> tuple[TrialInfo, TrialValue]
Wrapper around run() to execute and check the execution of a given config. This function encapsulates common handling/processing, so that run() implementation is simplified.
| PARAMETER | DESCRIPTION |
|---|---|
trial_info
|
Object that contains enough information to execute a configuration run in isolation.
TYPE:
|
dask_data_to_scatter
|
When a user scatters data from their local process to the distributed network, this data is distributed in a round-robin fashion grouping by number of cores. Roughly speaking, we can keep this data in memory and then we do not have to (de-)serialize the data every time we would like to execute a target function with a big dataset. For example, when your target function has a big dataset shared across all the target function, this argument is very useful. |
| RETURNS | DESCRIPTION |
|---|---|
info
|
An object containing the configuration launched.
TYPE:
|
value
|
Contains information about the status/performance of config.
TYPE:
|
Source code in smac/runner/abstract_runner.py
submit_trial
#
submit_trial(trial_info: TrialInfo) -> None
This function submits a trial_info object in a serial fashion. As there is a single
worker for this task, this interface can be considered a wrapper over the run method.
Both result/exceptions can be completely determined in this step so both lists are properly filled.
| PARAMETER | DESCRIPTION |
|---|---|
trial_info
|
An object containing the configuration launched.
TYPE:
|
Source code in smac/runner/abstract_serial_runner.py
wait
#
The SMBO/intensifier might need to wait for trials to finish before making a decision. For serial runners, no wait is needed as the result is immediately available.