Skip to content

Record per-task judge, sandbox and scoring-code time - #499

Merged
gregorybchris merged 12 commits into
mainfrom
chrisg/task-scoring-seconds
Oct 26, 2026
Merged

gregorybchris merged 12 commits into
mainfrom
chrisg/task-scoring-seconds

Conversation

@gregorybchris

@gregorybchris gregorybchris commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Each task in metrics.json now records how long its scoring spent on judge model calls, sandbox runs and its own scoring code. The dashboard stores the three values and shows them on a run's Tasks tab and in each task's details.

Why

A task's wall time doesn't say where the time went. Evals are slow for different reasons: a stronger judge model, a slow evaluated model, sandboxed code execution, or heavy answer checking. The run already records the overall time (first_request_at, last_completed_at, processing_seconds) and each task's share of model inference (attributed_inference_seconds, #498). This PR adds the scoring components.

What is measured

Each value is a sum of pieces timed on their own, so concurrent work counts in full and a value can exceed the wall time it took. The values don't add up to wall time, but they show where the work went.

Key What it sums
scoring_judge_seconds Each judge model call, from request to reply. Includes the client's own retries; excludes waiting for a free judge slot.
scoring_sandbox_seconds Each sandbox operation, from getting a sandbox to its result. Excludes waiting for a free sandbox.
scoring_compute_seconds Time running the task's scoring code: answer extraction, scorers and metric computation, on the event loop, in a scoring thread, or in the scoring process pool.

How (src/olmo_eval/common/scoring_time.py):

  • The runner makes the task's ScoringTimes current for each instance it scores (a ContextVar). Judge call sites (build_openai_judge_fn, provider judges, the two vision judges) and SandboxManager._execute_with_lease time each call into it.
  • Compute is measured by driving the scoring coroutine step by step and timing each step. A task factory installed for the scoring loop does the same for tasks the scorers start, since Task.score_responses gathers its async scorers. Steps never overlap, so CPU-bound scoring is credited to its own task even while judge calls from other tasks are waiting.
  • Process-pool workers time each output and send the time back. Each worker warms its scorer up first (ProcessScorer.warmup; MinervaMathScorer loads sympy), so start-up isn't counted.

Not recorded: judge and tool calls outside scoring (agent rollouts in inference workers, external benchmarks' own judges). Those tasks get 0.0 or, for the external runner, nothing.

The values are 0.0 when measured and nothing happened, and absent for older clients.

Dashboard

  • Contract: three optional fields on the task-result upload and on TaskRuntime.
  • Storage: migration 0008_scoring_times adds three nullable columns. A field that is unset leaves the upload's content hash unchanged, so older clients' re-uploads are unaffected.
  • Display: the run's Tasks tab has Judge, Sandbox and Scoring code columns, each shown only when some task in the run spent time on it. A task's details give a one-line breakdown. Negative values are stored as empty. The values are not divided by the number of inference workers, unlike inference time.

Affected specs: none. No requests, scores or task hashes change; this is runtime telemetry only.

Validation

  • uv run ruff check src/ tests/, uv run ruff format --check src/ tests/, uv run ty check src/
  • uv run pytest tests/ --ignore=tests/integration -q: 4,221 passed, 36 skipped
  • With the agents and litellm extras, tests/core tests/harness tests/runners tests/providers tests/common tests/evals/tasks: 2,739 passed, 31 skipped
  • dashboard/api: ruff, ty, and pytest. Locally 172 passed and 114 database tests skipped (no Postgres). CI's API job ran all 286 with Postgres and passed.
  • npm --prefix dashboard/ui run contract:check, typecheck, test (88 passed), lint
  • New tests cover:
    • a CPU-bound task scored alongside a judge task, through process_results, each getting its own time
    • scorer work in gathered child tasks
    • process-pool time with the warmup excluded
    • a judge request that is rejected and retried counting both attempts
    • waits for a sandbox slot left out
    • ingest storage, re-upload and hash compatibility, and the runtime pass-through
  • Mock runs, -m mock:
    • gsm8k + ifeval: compute only, no judge or sandbox time
    • minerva_math_algebra, limit=10: 0.09 s compute against 0.73 s processing (1.54 s before the warmup fix)

Not run: a Beaker trial with a real judge or sandbox task. The judge and sandbox call sites are covered by unit tests with fake clients only.

🤖 Generated with Claude Code

@gregorybchris
gregorybchris requested a review from a team as a code owner October 17, 2026 04:40
@gregorybchris
gregorybchris force-pushed the chrisg/attribute-chat-inference branch from db03cac to 11a0dab Compare October 26, 2026 19:59
Base automatically changed from chrisg/attribute-chat-inference to main October 26, 2026 21:11
gregorybchris and others added 3 commits October 26, 2026 14:17
Scoring runs in the main process event loop, concurrently across tasks. A
ShareClock splits the loop's scoring time across the instances being scored
at once, so judge calls and sandbox runs count toward their task without
double counting. Metric computation blocks the loop and is credited to its
task alone; writing predictions is credited to no task.

The new optional scoring_seconds field reaches metrics.json, the upload
payload, the ingest contract and a nullable task_results column. The ingest
content hash leaves it out when null so re-uploads of older results keep
their identity.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@gregorybchris
gregorybchris force-pushed the chrisg/task-scoring-seconds branch from 3b17b83 to 04014a0 Compare October 26, 2026 21:18
gregorybchris and others added 8 commits October 26, 2026 14:57
Replace the shared scoring-loop time with three per-task sums, each built
from pieces timed on their own: judge model calls, sandbox operations, and
the event loop's own scoring work. Compute time is measured per coroutine
step, so a CPU-bound scorer is no longer credited to judge calls that were
waiting at the same time. Waits for a judge or sandbox slot are not counted.

The values go to metrics.json only; the dashboard half is dropped until it
has a reader.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Scorers that Task.score_responses gathers run as their own asyncio tasks,
so their work was missing from compute time. A task factory installed for
the scoring loop now step-times every task started while scoring. Process
pool workers time each output and report it back, and the OCR scoring
thread times its own work. Docs now say what judge time includes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Each pool worker now warms a process scorer up once, before any output is
timed; MinervaMathScorer imports and calls its sympy checker. Child-task
timing no longer chains onto an existing task factory, which could count a
child's first step twice. Tests cover the runner installing and removing the
factory.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…oard

Carry scoring_judge_seconds, scoring_sandbox_seconds and scoring_compute_seconds
from the uploader through the ingest contract, API storage and read model into
the run Tasks tab and task drilldown.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Share the hash-optional field list with the re-upload test, store negative
scoring seconds as null, show scoring columns only when a row recorded them,
and use one set of labels and help text for the table and drilldown.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@gregorybchris gregorybchris changed the title Record per-task scoring time Record per-task judge, sandbox and scoring-code time Oct 26, 2026
Give the timing helpers one verb (measure_scoring, measure_instance_scoring,
add_scoring_seconds, install_child_task_timing), call the three components
kinds everywhere, and drop the _seconds suffix from ScoringTimes' fields.
Tests share one fake scoring clock. The dashboard names its constants after
the scoring kinds, and the migration is renamed 0008_scoring_seconds.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@gregorybchris
gregorybchris merged commit 4e7bb7b into main Oct 26, 2026
11 checks passed
@gregorybchris
gregorybchris deleted the chrisg/task-scoring-seconds branch October 26, 2026 23:08
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.

1 participant