LocalMetadataRunner¶
- class axtreme.runner.LocalMetadataRunner(evaluation_function: EvaluationFunction)¶
Bases:
Runner
Except for the addition of evauation_function this is coppied exactly from ax.runners.SyntheticRunner.
- __init__(evaluation_function: EvaluationFunction) None ¶
Methods
__init__
(evaluation_function)clone
()Create a copy of this Runner.
deserialize_init_args
(args[, ...])Given a dictionary, deserialize the properties needed to initialize the object.
poll_available_capacity
()Checks how much available capacity there is to schedule trial evaluations.
poll_exception
(trial)Returns the exception from a trial.
poll_trial_status
(trials)Checks the status of any non-terminal trials and returns their indices as a mapping from TrialStatus to a list of indices.
run
(trial)Deploys a trial based on custom runner subclass implementation.
run_multiple
(trials)Runs a single evaluation for each of the given trials.
serialize_init_args
(obj)Serialize the properties needed to initialize the object.
stop
(trial[, reason])Stop a trial based on custom runner subclass implementation.
Attributes
db_id
A list of keys of the metadata dict returned by run() that are relevant outside the runner-internal impolementation.
staging_required
Whether the trial goes to staged or running state once deployed.
- poll_trial_status(trials: Iterable[BaseTrial]) dict[TrialStatus, set[int]] ¶
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 – 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).
- run(trial: BaseTrial) dict[str, Any] ¶
Deploys a trial based on custom runner subclass implementation.
- Parameters:
trial – The trial to deploy.
- Returns:
Dict of run metadata from the deployment process.
- property run_metadata_report_keys: list[str]¶
A list of keys of the metadata dict returned by run() that are relevant outside the runner-internal impolementation. These can e.g. be reported in Scheduler.report_results().