Add resumable checkpoints to BenchmarkRunRecorder - #161
Merged
Merged
Conversation
This was referenced Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A restarted benchmark currently loses the predictions held by
BenchmarkRunRecorder. This adds opt-in checkpoint/restore directly to that recorder, preserving the existing run ID, prediction rows, start timestamp, dataset counters, metric functions, and parquet output.Integration
BenchmarkRunRecorder.checkpoint()persists pending rows; reopening a recorder with the same run and context restores them through the same row/counter update path used during inference.is_checkpointed()uses the existingbuild_sample_id()helper. Predictions are distinguished by existing fields:run_id,dataset_name,iteration_index,sample_id, andaug_pass. There is no separate work ID or alternate prediction schema.benchmarks/_checkpoint.py. Atomic batch files and a checksummed commit head distinguish committed records from interrupted writes. Incompatible manifests, corrupt/missing committed batches, cross-run rows, and conflicting replay fail explicitly.Scope and follow-ups
This is PR 1 of resumable benchmarks. Existing callers do not enable checkpointing yet. The next PR will connect it through shared tracker creation and inference, freeze the full sample/configuration manifest, and skip committed samples. bmcore follow-ups will add isolated Modal Volume mounts, replacement sandboxes, worker recovery, stale-run reconciliation, and idempotent finalization.
Checkpoint callers must supply a stable run ID, complete benchmark context (model/evaluator identity, source revisions, sample plan, seed, and scoring settings), and a filesystem-specific persistence callback when local fsync is insufficient. Recorder configuration is included automatically. One coordinator must own each run directory; distributed locking is not provided here. Checksums detect corruption, not malicious alteration of miner-controlled output.
Validation
ruff check src testsandgit diff --checkpassed.Modal Volume durability and end-to-end sandbox interruption recovery remain for the integration PRs; this PR verifies the recorder/storage contract locally.