smac.intensifier.abstract_parallel_intensifier

Classes

AbstractParallelIntensifier(scenario[, ...])

Common Racer class for Intensifiers that will schedule configurations on a parallel fashion.

Interfaces

class smac.intensifier.abstract_parallel_intensifier.AbstractParallelIntensifier(scenario, min_challenger=1, seed=None)[source]

Bases: AbstractIntensifier

Common Racer class for Intensifiers that will schedule configurations on a parallel fashion.

This class instantiates intensifier objects on a need basis, that is, to prevent workers from being idle. This intensifier objects will give configurations to run.

scenario : Scenario min_challenger : int, optional, defaults to 1

Minimum number of trials per config (summed over all calls to intensify).

seed : int | None, defaults to None

get_next_trial(challengers, incumbent, get_next_configurations, runhistory, repeat_configs=False, n_workers=1)[source]

This procedure decides from which instance to pick a config, in order to determine the next run. To prevent having idle workers, this procedure creates new instances up to the maximum number of workers available.

If no new intensifier instance can be created and all intensifier objects need to wait for more data, this procedure sends a wait request to smbo.

Parameters:
  • challengers (list[Configuration] | None) – Promising configurations.

  • incumbent (Configuration) – Incumbent configuration.

  • get_next_configurations (Callable[[], Iterator[Configuration]] | None, defaults to none) – Function that generates next configurations to use for racing.

  • runhistory (RunHistory) –

  • repeat_configs (bool, defaults to true) – If false, an evaluated configuration will not be generated again.

  • n_workers (int, optional, defaults to 1) – The maximum number of workers available.

Return type:

tuple[TrialInfoIntent, TrialInfo]

Returns:

  • TrialInfoIntent – Indicator of how to consume the TrialInfo object.

  • TrialInfo – An object that encapsulates necessary information of the trial.

process_results(trial_info, trial_value, incumbent, runhistory, time_bound, log_trajectory=True)[source]

The intensifier stage will be updated based on the results/status of a configuration execution. To do so, this procedures redirects the result argument, to the respective intensifier object that generated the original config.

Also, an incumbent will be determined. This determination is done using the complete run history, so we rely on the current intensifier choice of incumbent. That is, no need to go over each instance to get the incumbent, as there is no local runhistory

Parameters:
  • trial_info (TrialInfo) –

  • trial_value (TrialValue) –

  • incumbent (Configuration | None) – Best configuration seen so far.

  • runhistory (RunHistory) –

  • time_bound (float) – Time [sec] available to perform intensify.

  • log_trajectory (bool) – Whether to log changes of incumbents in the trajectory.

Return type:

tuple[Configuration, float | list[float]]

Returns:

  • incumbent (Configuration) – Current (maybe new) incumbent configuration.

  • incumbent_costs (float | list[float]) – Empirical cost(s) of the incumbent configuration.

property uses_seeds: bool

If the intensifier needs to make use of seeds.

Return type:

bool