Repository navigation
Image-QA benchmarks (4/5) - #323
Conversation
cad212e to
2b02bb4
Compare
a874370 to
675f516
Compare
e69f3d9 to
98676de
Compare
gregorybchris
left a comment
There was a problem hiding this comment.
This review was generated by an agent following
REVIEW_GUIDE.md. It is not from a human reviewer. Reply in the PR thread and a maintainer will follow up.
This is a big, careful port, and the vendored parsers with their byte-identical constant pins and dump-parity tests are exactly the right way to bring these benchmarks over. Ruff, ty, and the unit suite (2396 passed) pass locally.
I found four issues that affect task identity or persisted results, so I think they should be fixed before merge. The first two are the same bug classes Tyler flagged on #317 and #322 recurring in new code.
Blocking
-
src/olmo_eval/evals/vision/scoring/vqa.py:264andscoring/judges.py:561
MathVistaGptScorer.cache_dirandCharxivJudgeScorer.cache_dirdefault to a freshtempfile.mkdtemp(...)per process, andMetric.to_dictserializes scorer instances withasdict, so the cache path enters the task hash. I reproduced it: two consecutive processes givecharxiv_descriptivehashes79f3d83e...andea483ce4...,charxiv_reasoningdcb9a7b2...and6697c850..., andmath_vistaeaa0b125...andfe846043.... Every run of these three tasks therefore gets a unique task hash and artifact name, and storage and pairwise tooling can never match two runs of the same config.math_vista:offlineis stable. Please give these scorers (andDenseCaptionJudgeScorerin #317) ato_dictthat serializes onlytype,name, andmodel, and add a test that constructs the config twice and asserts equal hashes. -
src/olmo_eval/evals/vision/tasks/single_image.py:33,benchmarks/mmmu_pro.py:63,benchmarks/charxiv.py:111and:135
ChartQaSubsetMetric,MmmuProSettingMetric,CharxivScoreMetric, andCharxivInvalidCountMetricinherit the defaultcompute_instance, which falls back to the scorer channel. I reproduced all four: anauginstance underrelaxed_correctness_humanstores1.0; avisioninstance understandard_10_accuracystores1.0; a non-counting instance underdescriptive_countingstores1.0; and a validly graded instance undern_invalidstores1.0. Aggregates are right, so this is invisible inmetrics.json, but prediction exports and pairwise analysis are wrong for every subset metric in the suite. Please addcompute_instanceoverrides that returnNoneoutside the metric's scope (and0.0/1.0invalid-flag semantics forn_invalid), disable scorer fallback where there is no per-instance meaning, and extend the poison-the-scorer-channel regression test that the dense-caption and pointing families already have. -
src/olmo_eval/evals/vision/scoring/vqa.py:198,:292,:311
MathVistaOfflineScorer.scoreand both branches ofMathVistaGptScorer.ascore_with_contextcatch every exception and return0.0. An expiredOPENAI_API_KEY, a rate limit, or a bug innormalize_extracted_answertherefore becomes a zero for every affected instance and the run reports Success. This is the pattern Tyler asked to remove from the dense-caption judge in #317, for the same reason: the runner'sContextScorerwrapper only records a structured scoring error if the exception reaches it. Please let transport and programming errors propagate and handle only recognized extraction failures locally, recording a parse-status flag inoutput.metadataso a genuine zero is distinguishable from a failed extraction afterwards. -
src/olmo_eval/evals/vision/benchmarks/mmmu_pro.py:175
MmmuProTask.format_requestoverrides the base and resolves every image eagerly (c() if callable(c)) in the parent process, then puts the decoded PIL images on the request. That reintroduces the memory and pickling problem #317 fixed with lazy references, for up to seven images per instance across 3,460 standard-setting instances.common.images.resolve_imagesalready flattens list-valued and callable entries as of #324, so this can return the lazy partials from_attach_imagesand let the provider resolve them.
Non-blocking
-
src/olmo_eval/evals/vision/scoring/judges.py:475
The CharXiv grading call retries on any exception and returns the official dummy (score -1) after ten attempts. That is parity-faithful, andn_invalidmakes it visible, which is good. But an auth failure or outage still yields a complete run of zeros with Success. Could the task fail when every grading call returned the dummy, and could a 401 skip the retry ladder? -
src/olmo_eval/evals/vision/benchmarks/math_vista.py:40andbenchmarks/charxiv.py:189,:262
The comments "without the client every instance scores zero instead of failing the run" describe the behavior item 3 removes. Please update them together. -
src/olmo_eval/evals/vision/benchmarks/real_world_qa.py:53andmmiu.pyin #324
assertis used for dataset validation. Asserts are stripped under-Oand read as invariants rather than data checks; please raiseValueErrorwith the offending row. -
src/olmo_eval/evals/vision/scoring/mmmu_pro.py:150,scoring/judges.py:376, andscoring/multi_image.pyin #324
Mid-module imports with# noqa: E402in three files. Moving them to the top costs nothing and removes the suppressions. -
src/olmo_eval/evals/suites/molmo2.py
molmo2_imageqanow includesmath_vista(GPT extraction by default) and both CharXiv tasks, so the suite needsOPENAI_API_KEY. The README in #324 says two tasks call OpenAI; it is four, and the suite-level requirement is worth stating.
Nits
- Nit:
AnlsScorer.name = "ansl"is presumably vendored from mm_olmo's key; a comment saying the misspelling is deliberate would stop someone "fixing" it and breaking parity. - Nit:
scoring/__init__.pyre-exports about thirty parser functions; if the goal is a public surface for tests, a shorter list would be easier to keep stable.
Before merge
Items 1 through 4. Item 1 in particular should land together with the equivalent change in #317. Then merge once CI is green.
0430e99 to
a912923
Compare
ee5b6ba to
0351364
Compare
7b772bf to
5b1d4c6
Compare
5b1d4c6 to
a1fd19a
Compare
|
All four blocking items and the non-blocking ones are addressed; rebased onto 1 (blocking) — 2 (blocking) — 3 (blocking) — 4 (blocking) — already fixed: 5 — the CharXiv grader stops retrying on an auth failure instead of burning ten attempts to produce dummy scores (401/403 or an Nits: the Full suite 2,663 passed; lint/format/ |
gregorybchris
left a comment
There was a problem hiding this comment.
This review was generated by an agent following
REVIEW_GUIDE.md. It is not from a human reviewer. Reply in the PR thread and a maintainer will follow up.
Approving — all four blocking items are fixed, and the resolve_images gap you found while fixing item 4 was a good catch. Two non-blocking notes below.
Reproduced rather than read:
- Task hashes are stable.
charxiv_descriptive3aba511be7d9025f,charxiv_reasoningb362f8d52bd06cee,math_vistacc81822ca775050b— identical across two consecutive processes and unchanged underMATHVISTA_GPT_CACHE_DIR=/tmp/zz. They were changing every process before (79ca4430→73089a4cand so on). Existing tasks are untouched:arc_easy,gsm8k,hellaswag,humaneval,dropall matchmainate1e16885. - Per-instance metrics are scoped.
ChartQaSubsetMetric(human)stores1.0for a human example andNonefor an augmented one;MmmuProSettingMetric(standard10)stores1.0in-setting andNonefor a vision example;MmmuProOverallMetricstoresNone;CharxivScoreMetricstores1.0graded /0.0on the dummy;n_invalidstores0.0graded and1.0invalid. All five reportsupports_pairwise_scorer_fallback() == False. LeavingMeanScorerMetricon the inherited fallback is right — it is literally the mean of the scorer channel. - Honest zeros. Both MathVista scorers catch only extraction errors, and
output.metadata["extraction_failed"]distinguishes a recorded zero from a wrong answer. The remainingexcept Exceptioninscoring/math_vista_offline.pyare inside the vendored offline parser and are parse-level, which is the right place for them. The CharXiv auth short-circuit raises instead of burning the ladder into dummy scores. - Lazy images.
MmmuProTask._attach_imagesreturns the partials, andresolve_imagesdroppingNoneentries is the right fix — the unused slots of MMMU-Pro's variable image count would otherwise have reached the provider as holes. - Items 5 through 8 and the
anslnit all check out; no# noqa: E402remains anywhere inevals/vision/.
Locally: 2643 passed, 32 skipped; ruff, format and ty clean (the single ty diagnostic is the pre-existing harness/sandbox/executor.py suppression, untouched here). CI is green.
Non-blocking
-
src/olmo_eval/evals/vision/benchmarks/charxiv.py:99
_resultsflattens every output, so anum_samples > 1run averages the samples rather than applyingTaskConfig.output_score_aggregation(default MAX), and_result_for(:106) takes the first output for the per-instance value. I reproduced it: two instances sampled twice with scores[0, 1]and[1, 0]givecompute() == 0.5andcompute_instance() == 0.0, where MAX aggregation gives1.0. The same shape is intasks/pointing.py:131andtasks/single_image.py:18, noted on #322. Nothing here setsnum_samples > 1, so it only bites on an explicit-o sampling_params.num_samples=N— butdense_captionrejects that configuration outright, and it would be good for the judged benchmarks to be consistent with it one way or the other. -
Item 9 is handled, but not in this PR
The README lives in #324, and #324 does now say four tasks call OpenAI and thatmolmo2_imageqaneeds the key as a suite — so this is genuinely covered. Just flagging that the note above describing it as landed here doesn't match the diff; this PR touches noREADME.md. Worth keeping the two straight so the item doesn't look done twice or not at all.
Before merge
Nothing. Both items are fine as follow-ups, and item 1 would sit naturally with #392. Merge once CI is green.
|
Correction to my earlier reply: I listed item 9 (the OpenAI-key README note) as addressed here, but this PR doesn't touch |
f183504 to
3074aa3
Compare
Fourth of five PRs splitting #278. Lands the flagship image-QA family — 12 benchmarks and the `molmo2_imageqa` suite (14 names with the counting pair), plus `molmo2_imageqa_caption` now spanning QA + dense caption. The scoring layer grows the vendored parsers (VQA normalization, the MMMU multiple-choice/open parser shared with mmmu_pro and the multi-image family, MathVista offline extraction, the byte-exact CharXiv grading prompts) and the QA scorer classes join the counting scorer in `scoring/vqa`. The CharXiv GPT judge and MathVista's GPT extraction join the dense-caption judge in `scoring/judges`, sharing its cached-call machinery. The judge-scored tasks (charxiv x2, math_vista) declare `required_secrets=("OPENAI_API_KEY",)` so beaker mounts the key their judges always needed. CharXiv's vendored prompts keep their trailing whitespace (it is part of the official prompt bytes); lint exempts vendored modules file-by-file. Every moved symbol is AST-verified against the reviewed #278 code; the only changed definitions are the VisionTask consolidation and the added secrets. Co-authored-by: Ziqi Gao (Roy) <[email protected]>
The official retry ladder retries with no wait, so with grading fanned out concurrently one transient API condition burned all 10 retries in milliseconds and forced dummy scores that count as zero. Retries now wait a randomized exponential backoff, and the final failure logs the last raw reply.
…st zeros - CharxivJudgeScorer and MathVistaGptScorer serialize only type/name/model, so their per-process cache directory no longer enters the task hash. Every run of charxiv_descriptive, charxiv_reasoning and math_vista previously got a unique hash and artifact name, which storage and pairwise tooling could never match; a test now pins hash stability across constructions. - ChartQaSubsetMetric, MmmuProSettingMetric, MmmuProOverallMetric, CharxivScoreMetric and CharxivInvalidCountMetric implement compute_instance and disable scorer fallback, so out-of-scope rows persist nothing instead of the overall scorer value. n_invalid stores the per-example invalid flag. - MathVista's offline and GPT scorers catch only extraction failures, which are recorded in output.metadata as extraction_failed; an expired key, a rate limit or a normalizer bug now reaches the runner's scoring errors. - The CharXiv grader stops retrying on an auth failure rather than burning ten attempts to produce dummy scores. - resolve_images drops slots that resolve to nothing, for MMMU-Pro's variable image count; the three metric classes moved here from the pointing PR, where nothing used them; dataset validation raises instead of asserting; the mid-module imports and their E402 suppressions are gone.
3074aa3 to
e2e5291
Compare
Description
Fourth of five PRs splitting #278 (stack: #316 → #317 → #322 → this). Milestone: the flagship
molmo2_imageqasuite — 14 tasks — runs end to end.Benchmarks (12 new; the suite's other 2 are PR 3's counting tasks)
ai2d, chart_qa, doc_qa, info_qa, math_vista, mmmu, mmmu_pro, real_world_qa, text_vqa, vqa2, charxiv_descriptive, charxiv_reasoning — with their variants (
math_vista:offline|gpt,ai2d:transparent|test,chart_qa:test).mmmu_prostays decoupled frommmmu(own prompts/parser/scorer, faithful to the official repo; primary = SOTA-reported overall).Suites:
molmo2_imageqa(AVERAGE, all 0-1 primaries) andmolmo2_imageqa_caption(DISPLAY_ONLY — dense caption reports 0-100).Scoring layer
scoring/vqa_normalization.py,multiple_choice.py(the MMMU parser, shared with mmmu_pro and the PR-5 multi-image family),math_vista_offline.py,mmmu_pro.py,charxiv.py— vendored parsers/prompts, behavior-preserving; CharXiv's trailing whitespace is part of the official prompt bytes, so lint exempts vendored modules file-by-filescoring/vqa.py; the CharXiv judge and MathVista GPT extraction join the dense-caption judge inscoring/judges.py, sharing its cached-call machineryscoring/__init__.pyre-exports the parser functions (internal toevals.vision, so no cycle withcommon/scorers)Fixes
required_secrets=("OPENAI_API_KEY",)on charxiv_descriptive/reasoning and math_vista — same beaker live-bug as dense caption in Vision task framework + captioning benchmarks (2/5) #317Verification
test_image_qa_requests.pytycleanuv run pytest tests/evals/vision/ -q # 185 passed — the whole vision family uv run pytest tests/ --ignore=tests/integration -qType of Change
Checklist
Part of #278 (tracking). Next: PR 5 — multi-image + docs.