Struct AshaPruner
pub struct AshaPruner { /* private fields */ }Expand description
The asynchronous successive-halving pruner.
§The promotion rule, precisely
On a report at step:
- If
stepis not exactly a rung resource level, the trial has not just reached a rung —Decision::Continue. (Deciding only at exact rung steps is what lets the value being judged, and every competitor’s value, be the value at that resource; a trial whose cadence never lands on a rung is never gated there, a safe omission — it is never wrongly pruned.) - Otherwise gather the values of every trial that reached this rung — from
the typed
StudyView, not a side-table — and applyis_promotable: promoted iff in the top1/η, with the firstη − 1arrivals promoted optimistically so a rung baseline can form. Promote →Decision::Continue; otherwiseDecision::Prune.
A trial pruned at a rung keeps its value there as its objective value (the pruned-adopts-last-intermediate rule — why a pruning example’s curve falls), which is exactly what makes the rung comparison for later trials sound.
§Multi-objective
Successive halving ranks a single objective, so a multi-objective study is
never pruned (returns Decision::Continue) rather than gate on one
dimension and risk pruning a Pareto-optimal trial.
§Determinism
The decision is a pure function of the ask-time StudyView, so it depends
on which trials had filled the rung when this one was asked — completion-order
dependent under parallelism. An ASHA-scheduled study is therefore
replayable, not pre-determined (where determinism
stops); under a
single worker with a fixed seed the pruning is fully reproducible.
§Where the rung table lives
Nowhere persistent. Optuna records rung membership as system_attrs strings;
atune derives it from the StudyView’s typed intermediate reports on each
call. The typed shape it
takes when a caller wants to store or inspect it is RungTable, available
through rung_table and round-trippable through a
StateBlob on
Scope::Scheduler — typed state, never
attr-string hacks. Because the decision needs
no persisted state, state returns None.
use atune_core::scheduler::AshaPruner;
// Rungs at 1, 3, 9 env-steps (η = 3), finishing at 27.
let asha = AshaPruner::new(1, 27, 3)?;
assert_eq!(asha.ladder().rungs(), [1, 3, 9]);Implementations§
§impl AshaPruner
impl AshaPruner
pub fn new(
min_resource: u64,
max_resource: u64,
reduction_factor: u32,
) -> Result<Self>
pub fn new( min_resource: u64, max_resource: u64, reduction_factor: u32, ) -> Result<Self>
Builds an ASHA pruner over the ladder
(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>
pub fn with_default_eta(min_resource: u64, max_resource: u64) -> Result<Self>
pub const fn from_ladder(ladder: RungLadder) -> Self
pub const fn from_ladder(ladder: RungLadder) -> Self
Builds an ASHA pruner from an already-constructed ladder.
pub const fn with_objective(self, obj: usize) -> Self
pub const fn with_objective(self, obj: usize) -> Self
Selects which objective dimension to gate on (default 0).
pub const fn ladder(&self) -> &RungLadder
pub const fn ladder(&self) -> &RungLadder
The resource ladder this pruner gates on.
pub fn rung_table(&self, view: &StudyView) -> RungTable
pub fn rung_table(&self, view: &StudyView) -> RungTable
The typed rung table derived from view — the occupants of every rung.
The Scope::Scheduler state shape the
design mandates, built on demand rather than persisted: it round-trips
through a StateBlob and is handy for a
dashboard, a test, or M4’s DEHB.
Trait Implementations§
§impl Clone for AshaPruner
impl Clone for AshaPruner
§fn clone(&self) -> AshaPruner
fn clone(&self) -> AshaPruner
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more