Repository navigation
Conversation
This branch has not been deployed
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.
Fixes #392.
Description
Adds
ResponseBatchScorerso scorers whose reference protocol grades multiple responses per call (such ascharxiv_descriptive, which groups responses by question template idqidand grades 5 triplets per GPT-4o call) are fed deterministic batches of responses by bothTask.score_responsesand the async runner (runners/asynq/results.py), leaving the existing per-responseScorerpath untouched.What changed
ResponseBatchScorercontract (src/olmo_eval/common/scorers/execution.py,src/olmo_eval/common/scorers/__init__.py):ResponseBatchScorer(Scorer)withrequires_async = True, configurablebatch_size: int | None = None(Nonegrades an entire bucket together), optionalbatch_key(response) -> Hashablefor grouping responses before batching, and abstractascore_batch(responses, context).src/olmo_eval/evals/tasks/common/base.py):Task._has_async_scorers, addedTask._get_response_batch_scorers, and updatedTask.score_responses/Task._apply_scorers_asyncto group responses byscorer.batch_key(response), chunk byscorer.batch_size, runscorer.ascore_batchbounded byScoringContext.scoring_concurrency, support both single-output and multi-output score sequences, and record structured per-outputscoring_errorson failure without aborting other batches or losing sync scorer results.src/olmo_eval/runners/asynq/results.py):process_resultsto buffer incoming responses for tasks withResponseBatchScorerusing an instance-order watermark cursor (skipping restored and hard-failed instances without stalling), dispatchingscore_batch_and_storeas soon as a bucket reachesbatch_sizeand flushing partial remainder batches when all instances for the task have arrived, while keeping the existing per-responsescore_and_storepath unchanged for all other tasks.src/olmo_eval/evals/vision/scoring/judges.py,src/olmo_eval/evals/vision/benchmarks/charxiv.py):CharxivJudgeScorertoResponseBatchScorer(batch_size=5grouped byqidforcharxiv_descriptive,batch_size=1forcharxiv_reasoning), honoringcache_dir,cache_only, andrecomputewhile removing the bespokescore_responsesoverrides fromCharxivDescriptiveTaskandCharxivReasoningTask. Under the async runner,charxiv_descriptivenow batches up to 5 same-template questions per GPT call (~800 calls on the 4,000-instance split instead of 4,000).tests/core/test_response_batch_scorer.py,tests/evals/vision/test_charxiv.py):ResponseBatchScorerchunking,batch_keygrouping,batch_size=None, multi-output scores, batch error isolation, deterministic instance-order runner batching across out-of-order worker arrivals, hard-failure/restored-instance skipping, andCharxivDescriptiveTask/CharxivReasoningTaskbatch grading.Affected results
charxiv_descriptive: When run via the async runner (process_results), descriptive grading now batches up to 5 responses sharing the same templateqidper GPT-4o call in instance order (matching the official CharXiv evaluation protocol and directTask.score_responses(all_responses)calls), rather than issuing 1 question per GPT call. Task hashes (3aba511be7d9025fandb362f8d52bd06cee) are unchanged.Type of Change
Validation
Executed on Windows (
win32, Python 3.13.1, commit928ae66f9d28391afb9fb9c53f302f59b181e556) usinguv run --frozen --no-sync --no-group vllm --extra clients --extra litellm --extra agents:uv run --frozen --no-sync --no-group vllm --extra clients --extra litellm --extra agents ruff check src/ tests/andruff format --check src/ tests/— passed (All checks passed!,757 files already formatted)uv run --frozen --no-sync --no-group vllm --extra clients --extra litellm --extra agents ty check --python-platform linux src/— passed (All checks passed!)./scripts/check_file_sizes.sh— passed (All 1164 tracked files are within 1.00 MB.)uv build— built source distribution and wheel cleanlytests/core/test_response_batch_scorer.py,tests/evals/vision/,tests/evals/tasks/test_base.py,tests/evals/tasks/test_task_hashes.py,tests/runners/,tests/common/test_scoring_time.py,--ignore=tests/runners/test_resume.py) —568 passed, 4 skippedtests/common,tests/core,tests/evals,tests/harness,tests/inference,tests/providers,tests/runners,tests/cli/test_{arg_round_trip,dotlist_overrides,harness_overrides,output_dir_default,utils}.py,tests/cli/beaker/test_{example_configs,sglang_install}.py,tests/test_package.py,tests/test_readme.py,tests/test_runner.py, excluding the Windows-incompatible POSIX/pexpect.spawn/os.O_DIRECTORY/Unix-PATH files listed under Remaining work) —4336 passed, 23 skippedtests/core/test_response_batch_scorer.py,tests/evals/vision/test_charxiv.py)Remaining work
uv run pytest tests/ --ignore=tests/integration -v) and Docker integration tests (tests/integration/) need to run on GitHub Actions Linux runners; on Windows, POSIX/Linux-specific test modules (test_http_command.py,test_http_session.py,test_owned_docker_deployment.py,test_sandbox_executor.py,test_terminal_bench_external.py,test_livecodebench.py,test_ruler_plus.py,test_vllm_server_startup.py,test_resume.py,test_results_upload.py[sigterm],tests/data/,tests/upload/,tests/scripts/,tests/cli/beaker/test_{build_image_script,launch,resume_access,upload_wiring}.py) were excluded or skipped.