You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extract MapDataReplayState for multi-metric experiment replay (#5084)
Summary:
The experiment replay system (`MapDataReplayMetric`, `MapDataReplayRunner`, `replay_experiment`) is hardcoded for single-objective optimization, blocking multi-objective early stopping. `MapDataReplayMetric` conflates data serving with progression state (offset, scaling factor, per-trial step counters), so multiple metrics cannot share a coherent timeline. The scaling factor -- `mean((last_step - offset) / num_points)` -- is an unmotivated heuristic that distorts cross-trial timing. The runner is tightly coupled to a single metric instance.
This diff extracts shared state into a `MapDataReplayState` coordinator. The runner owns progression, the metric is a read-only accessor.
**Key changes:**
- **`MapDataReplayState`** (new): Normalized cursor model. Computes global `min_prog`/`max_prog` across all metrics and trials, advances per-trial cursors by fixed `step_size`, maps to raw progression via `curr_prog = min_prog + cursor * (max_prog - min_prog)`. Serves original MAP_KEY values; downstream ESS normalizes independently.
- **`MapDataReplayMetric`** (simplified): Thin wrapper holding a state reference and `metric_signature`. Delegates `fetch_trial_data` to `state.get_data()`. All state-owning attributes removed.
- **`MapDataReplayRunner`** (simplified): Takes shared state instead of metric. Calls `advance_trial()` for running trials.
- **`replay_experiment`**: Accepts `metrics: list[Metric]`. Builds `OptimizationConfig` or `MultiObjectiveOptimizationConfig` accordingly. Extracts objective thresholds from the historical experiment's config. Re-indexes non-contiguous trial indices to contiguous `0, 1, 2, ...`. Deprecates `num_samples_per_curve` (superseded by `step_size`).
- **`estimate_hypothetical_early_stopping_savings`**: Updated for `metrics: list[Metric]`.
- **Removed**: `_compute_trial_stats`, `_compute_scaling_factor` (superseded by cursor model).
- **Downstream consumers updated**: `ax_sweep_orchestrator`, `early_stopping_healthcheck`.
Differential Revision: D96999702
0 commit comments