smac.intensification.parallel_scheduling

Classes

ParallelScheduler(stats, traj_logger, rng, ...)

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

class smac.intensification.parallel_scheduling.ParallelScheduler(stats, traj_logger, rng, instances, instance_specifics=None, cutoff=None, deterministic=False, initial_budget=None, max_budget=None, eta=3, num_initial_challengers=None, run_obj_time=True, n_seeds=None, instance_order='shuffle_once', adaptive_capping_slackfactor=1.2, inst_seed_pairs=None, min_chall=1, incumbent_selection='highest_executed_budget')[source]

Bases: smac.intensification.abstract_racer.AbstractRacer

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

Parameters
  • stats (smac.stats.stats.Stats) – stats object

  • traj_logger (smac.utils.io.traj_logging.TrajLogger) – TrajLogger object to log all new incumbents

  • rng (np.random.RandomState) –

  • instances (List[str]) – list of all instance ids

  • instance_specifics (Mapping[str, str]) – mapping from instance name to instance specific string

  • cutoff (Optional[int]) – cutoff of TA runs

  • deterministic (bool) – whether the TA is deterministic or not

  • initial_budget (Optional[float]) – minimum budget allowed for 1 run of successive halving

  • max_budget (Optional[float]) – maximum budget allowed for 1 run of successive halving

  • eta (float) – ‘halving’ factor after each iteration in a successive halving run. Defaults to 3

  • num_initial_challengers (Optional[int]) – number of challengers to consider for the initial budget. If None, calculated internally

  • run_obj_time (bool) – whether the run objective is runtime or not (if true, apply adaptive capping)

  • n_seeds (Optional[int]) – Number of seeds to use, if TA is not deterministic. Defaults to None, i.e., seed is set as 0

  • instance_order (Optional[str]) – how to order instances. Can be set to: [None, shuffle_once, shuffle] * None - use as is given by the user * shuffle_once - shuffle once and use across all SH run (default) * shuffle - shuffle before every SH run

  • adaptive_capping_slackfactor (float) – slack factor of adpative capping (factor * adaptive cutoff)

  • inst_seed_pairs (List[Tuple[str, int]], optional) – Do not set this argument, it will only be used by hyperband!

  • min_chall (int) – minimal number of challengers to be considered (even if time_bound is exhausted earlier). This class will raise an exception if a value larger than 1 is passed.

  • incumbent_selection (str) – How to select incumbent in successive halving. Only active for real-valued budgets. Can be set to: [highest_executed_budget, highest_budget, any_budget] * highest_executed_budget - incumbent is the best in the highest budget run so far (default) * highest_budget - incumbent is selected only based on the highest budget * any_budget - incumbent is the best on any budget i.e., best performance regardless of budget

get_next_run(challengers, incumbent, chooser, run_history, repeat_configs=False, num_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]) – promising configurations

  • incumbent (Configuration) – incumbent configuration

  • chooser (smac.optimizer.epm_configuration_chooser.EPMChooser) – optimizer that generates next configurations to use for racing

  • run_history (smac.runhistory.runhistory.RunHistory) – stores all runs we ran so far

  • repeat_configs (bool) – if False, an evaluated configuration will not be generated again

  • num_workers (int) – the maximum number of workers available at a given time.

Return type

Tuple[RunInfoIntent, RunInfo]

Returns

  • intent (RunInfoIntent) – Indicator of how to consume the RunInfo object

  • run_info (RunInfo) – An object that encapsulates the minimum information to evaluate a configuration

process_results(run_info, incumbent, run_history, time_bound, result, log_traj=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
  • run_info (RunInfo) – A RunInfo containing the configuration that was evaluated

  • incumbent (Optional[Configuration]) – Best configuration seen so far

  • run_history (RunHistory) – stores all runs we ran so far if False, an evaluated configuration will not be generated again

  • time_bound (float) – time in [sec] available to perform intensify

  • result (RunValue) – Contain the result (status and other methadata) of exercising a challenger/incumbent.

  • log_traj (bool) – Whether to log changes of incumbents in trajectory

Return type

Tuple[Configuration, float]

Returns

  • incumbent (Configuration) – current (maybe new) incumbent configuration

  • inc_perf (float) – empirical performance of incumbent configuration