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: BaseTrial) Dict[str, Any][source]#

Deploys a trial based on custom runner subclass implementation.

Parameters:

trial (BaseTrial) – The trial to deploy.

Returns:

Dict of run metadata from the deployment process.

Return type:

Dict[str, Any]

poll_trial_status(trials: Iterable[BaseTrial]) 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[BaseTrial]) – 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:

Dict[TrialStatus, Set[int]]

to_dict() dict[source]#

Convert runner to a dictionary.

Return type:

dict