Module pb2_bench
Expand description
The M6.3 PB2 oracle’s driver: prove Pb2 — the
time-varying GP-bandit variant of PBT — beats a random-perturbation PBT
on a non-stationary problem where modelling (time, hyperparameter) → improvement genuinely pays (docs/design/09-implementation.md §8.3, §15).
This is the sibling of pbt_bench: it drives the real
study loop with the real Pb2 scheduler over the same
ScheduleProblem — the
Fork path, the
checkpoint-reference hand-off and the recorded lineage all exercised
end-to-end — and reuses the identical PbtReport
so the two schedulers are compared like with like.
§Why the win is the GP-bandit’s, not the population machinery’s (§8.3)
PBT tracks a moving optimum by a blind perturbation (a coin-flipped
multiplicative step) plus selection: half its explores go the wrong way and are
culled. PB2 replaces that coin with the perturbation that maximizes a
time-varying GP-UCB — it fits a GP to the population’s (t, θ) → improvement
history and moves toward the modelled current optimum every time. On a
non-stationary problem the time-aware model tracks the drift with far fewer
wasted evaluations, so at a matched budget PB2 reaches a higher total.
The regression-bite the oracle rests on: run PB2 with its GP-UCB explore
step turned off (Pb2::with_gp_exploit(false)) and it is PBT’s
population machinery driven by a blind local perturbation — the win must
collapse. It does (see tests/pb2_oracle.rs), which is what proves the win is
the GP-bandit’s doing rather than the fork/checkpoint plumbing’s.
§Determinism
Single-worker with a fixed seed, so the whole population trajectory, the winner
and its lineage replay bit-for-bit on a given platform
(docs/design/09-implementation.md §5). The reward path uses libm transcendentals
(log10/powf), so the headline margins are asserted with tolerance, not as
exact goldens — the same stance pbt_bench takes.
Functions§
- control_
pb2 - The control arm: the tuned PB2 with its GP-UCB explore step turned off, so every exploit uses a blind random perturbation — PBT’s population machinery without the bandit. The §8.3 regression-bite compares against this.
- drift_
problem - The fast-drift non-stationary problem the ablation runs on — the regime
where PB2’s time-awareness genuinely pays (
docs/design/09-implementation.md§8.3). - run_pb2
- Runs single-worker PB2 over
problemforbudgettrials and assembles the samePbtReportthe PBT driver does. - tuned_
pb2 - The tuned PB2 scheduler the oracle uses over
drift_problem.