Skip to content

feat(gdpval): resume multi-stage ELO from cache - #1933

Merged
vadam5 merged 2 commits into
mainfrom
agronskiy/feat/gdpval/resuing-of-stages-1-2
Jul 6, 2026
Merged

feat(gdpval): resume multi-stage ELO from cache#1933
vadam5 merged 2 commits into
mainfrom
agronskiy/feat/gdpval/resuing-of-stages-1-2

Conversation

@agronskiy

Copy link
Copy Markdown
Contributor

Summary

Make resume_from_cache work for multi-stage GDPval/stirrup ELO runs. Previously the multistage driver bypassed the standard rollout-collection resume: a rerun re-planned and re-executed every stage, a crash lost in-progress results, and with multistage.seed unset the adaptive task/reference sampling diverged on rerun.

What changed

  • Fingerprinted stage journal (<stem>_multistage_state.jsonl): per-stage planned record (chosen references, task ids, seed, prior ELO) written before dispatch + a complete marker at stage end. A config fingerprint invalidates stale caches.
  • Stage-keyed instance of the core success/failure-sidecar contract: successes → main jsonl, non-kill failures → attempt-capped _failures.jsonl, kill-shaped → nowhere. Failures never contaminate the main jsonl or ELO.
  • Resume-aware run_multistage_stages (pure, injectable StageResume seam): completed stages reuse cached judging results and re-fit ELO from rows; an interrupted stage replays its recorded references (deterministic even when seed is None) and re-dispatches only not-yet-done (stage, task, rollout) rows. Per-task reuse within a partially-done stage is served by the stirrup agent's reference-subset-keyed /verify cache (rerun_incomplete).
  • Fixes a fresh-run persistence gap: _prepare_resume now always returns a writing StageResume, so a fresh run persists the journal + rows (previously nothing was written on the first run, making resume impossible).

Test plan

  • Unit: 63 tests pass in resources_servers/gdpval/tests/ — incl. fresh→resume cycle, interrupted-stage partial re-dispatch, plan replay with seed=None, failure routing (attempt cap / terminal), and fingerprint invalidation.
  • End-to-end on HSG (nano-3.5, gdpval multistage comparison, stages [5, 5×num_models:2]):
    1. Launched a run; let stage 1 complete and stage 2 begin (4/5 stage-2 deliverables produced).
    2. Interrupted the job mid–stage 2 (nel kill).
    3. Ran nel resume → run completed to SUCCESS.
    4. Verified from the run logs that resume worked as intended:
      • resuming multi-stage run from cache (fingerprint match)
      • stage 1/2 reused from cache: eval ELO = 720.0 (5 cached rollout(s)) — stage 1 not re-run
      • stage 2/2 (replayed from journal): 5 task(s) vs 2 ref(s) ['gemma4_26b','gptoss_120b'] — references replayed from the journal (with seed=null, only possible via persistence)
      • stage 2 reused the 4 pre-interrupt deliverables + computed the 1 remaining; final rollouts = 5 stage-0 + 5 stage-1.

🤖 Generated with Claude Code

agronskiy and others added 2 commits July 5, 2026 15:55
Make resume_from_cache work for multi-stage GDPval/stirrup ELO runs. The
multistage driver bypassed the standard rollout-collection resume, so a
rerun re-planned and re-executed every stage and lost stage results on a
mid-run crash.

- Persist a fingerprinted stage journal (plan + completion marker) so an
  interrupted stage replays the exact references/tasks it was using
  (deterministic even when multistage.seed is None).
- Persist stage rollout rows incrementally as a stage-keyed instance of the
  core success/failure-sidecar contract (attempt-capped, terminal-aware);
  failures never contaminate the main jsonl or ELO.
- Resume-aware run_multistage_stages: completed stages reuse cached judging
  results and re-fit ELO from rows; the interrupted stage re-dispatches only
  not-yet-done (stage, task, rollout) rows against the recorded references.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Alex Gronskiy <agronskiy@nvidia.com>
The multi-stage resume journal was only ever produced when a prior cache
already existed: _prepare_resume returned None on a fresh run, and with
resume=None the staged loop persisted nothing. So the first run never wrote
<stem>_multistage_state.jsonl, making a later nel resume impossible (it re-ran
every stage). A live nano-3.5 cluster run surfaced this — both stages completed
but no journal was written.

_prepare_resume now always returns a file-backed StageResume (writing
callbacks), clearing stale files on fresh/stale/disabled paths and reusing prior
state only on a valid fingerprint-matching resume. Fresh runs therefore persist
the journal (plan at stage start, complete marker at stage end) and incremental
rows, so resume has state to read. Regression test covers the fresh->resume
cycle through _prepare_resume (the integration path the pragma had hidden).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Alex Gronskiy <agronskiy@nvidia.com>

@vadam5 vadam5 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@vadam5
vadam5 merged commit daa349a into main Jul 6, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants