Skip to main content

HyperbandPruner

Struct HyperbandPruner 

pub struct HyperbandPruner { /* private fields */ }
Expand description

Asynchronous Hyperband: a fan of AshaPruner brackets over one ladder.

§The bracket schedule

From (min_resource, max_resource, reduction_factor η) the number of brackets is s_max + 1, where s_max = floor(log_η(max / min)) is the most aggressive bracket whose first rung still fits under the maximum. Bracket s is an AshaPruner over the sub-ladder starting at min · ηˢ:

Bracket sFirst rungCharacter
0minmost rungs — aggressive early stopping, exploration
…min · ηˢfewer rungs
s_maxmin · η^{s_max}one rung near the top — little pruning, exploitation

§Bracket assignment

bracket_of(study, trial_number, n_brackets) — crc32(study ‖ trial_number) mod n_brackets. It is a pure function of identifiers every worker already has, so no bracket-assignment table is shared or persisted: two processes place the same trial in the same bracket by computing it, never by coordinating.

§Promotion within a bracket

Identical to AshaPruner, with the rung’s occupants filtered to the trials in the same bracket (each trial’s bracket is recomputed with the same pure function). A multi-objective study is never pruned; NaN at a rung is pruned.

§Determinism

Bracket assignment is pre-determined (a pure function of (study, number)), but the promotion decision, like AshaPruner’s, reads the ask-time StudyView and so depends on which same-bracket trials had filled the rung — replayable, not pre-determined, under parallelism (where determinism stops). Single-worker with a fixed seed is fully reproducible.

use atune_core::scheduler::HyperbandPruner;

// η = 3, from 1 to 27: brackets start at 1, 3, 9, 27 -> 4 brackets.
let hb = HyperbandPruner::new(1, 27, 3)?;
assert_eq!(hb.brackets(), 4);

Implementations§

§

impl HyperbandPruner

pub fn new( min_resource: u64, max_resource: u64, reduction_factor: u32, ) -> Result<Self>

Builds a Hyperband pruner over (min_resource, max_resource, reduction_factor).

§Errors

Error::InvalidSpace for a nonsense ladder — see RungLadder::new.

pub fn with_default_eta(min_resource: u64, max_resource: u64) -> Result<Self>

Builds a Hyperband pruner with the default reduction factor.

§Errors

As new.

pub fn with_objective(self, obj: usize) -> Self

Selects which objective dimension to gate on (default 0), propagating it to every bracket.

pub fn brackets(&self) -> u32

The number of brackets.

pub const fn min_resource(&self) -> u64

The first rung’s resource.

pub const fn max_resource(&self) -> u64

The finish line.

pub const fn reduction_factor(&self) -> u32

The geometric factor η.

pub fn bracket_for(&self, view: &StudyView, number: TrialNumber) -> u32

The bracket a trial is assigned to.

Trait Implementations§

§

impl Clone for HyperbandPruner

§

fn clone(&self) -> HyperbandPruner

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for HyperbandPruner

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl Scheduler for HyperbandPruner

§

fn on_report( &self, study: &StudyView, trial: &TrialMeta, step: u64, values: &[f64], ) -> Result<Decision>

Assigns the trial to its bracket and applies that bracket’s ASHA rule against the same-bracket occupants; see the type docs.

§Errors

Never — the decision is total.

§

fn state(&self) -> Result<Option<SchedulerState>>

None: bracket assignment is a pure function and rung tables are derived from the StudyView — nothing to persist.

§

fn fan_report_mode(&self) -> FanReportMode

Declares whether this scheduler accepts aligned aggregate fan reports. Read more
§

fn scripted_capability(&self) -> ScriptedSchedulerCapability

Declares whether scripted ask/tell can recreate this scheduler. Read more
§

fn on_trial_end( &self, study: &StudyView, trial: &FrozenTrial, ) -> Result<Vec<Command>>

Called once a trial reaches a terminal state. Read more
§

fn resume_candidates(&self, study: &StudyView) -> Result<Vec<Command>>

Paused trials worth waking on a freed work slot, in priority order. Read more
§

fn restore_state(&self, blob: &SchedulerState) -> Result<()>

Restores a scheduler from a previously persisted blob. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more