Wrapped Runner#
Runner that calls your wrappers to run your model and poll the trial status.
- class boa.runner.WrappedJobRunner(wrapper: Optional[BaseWrapper] = None, *args, **kwargs)[source]#
Bases:
Runner- Parameters
wrapper (BaseWrapper) –
- run(trial: Trial) Dict[str, Any][source]#
Deploys a trial based on custom runner subclass implementation.
- run_multiple(trials) Dict[int, Dict[str, Any]][source]#
Runs a single evaluation for each of the given trials. Useful when deploying multiple trials at once is more efficient than deploying them one-by-one. Used in Ax
Scheduler.NOTE: By default simply loops over run_trial. Should be overwritten if deploying multiple trials in batch is preferable.
- Parameters
trials – Iterable of trials to be deployed, each containing arms with parameterizations to be evaluated. Can be a Trial if contains only one arm or a BatchTrial if contains multiple arms.
- Returns
Dict of trial index to the run metadata of that trial from the deployment process.
- Return type
- poll_trial_status(trials: Iterable[Trial]) Dict[TrialStatus, Set[int]][source]#
Checks the status of any non-terminal trials and returns their indices as a mapping from TrialStatus to a list of indices. Required for runners used with Ax
Scheduler.NOTE: Does not need to handle waiting between polling calls while trials are running; this function should just perform a single poll.
- Parameters
trials (Iterable[Trial]) – Trials to poll.
- Returns
A dictionary mapping TrialStatus to a list of trial indices that have the respective status at the time of the polling. This does not need to include trials that at the time of polling already have a terminal (ABANDONED, FAILED, COMPLETED) status (but it may).
- Return type