Repository navigation
Vision task framework + captioning benchmarks (2/5) - #317
Conversation
d3f0311 to
0c80f37
Compare
94a37f0 to
1345105
Compare
2f9a116 to
4a612ad
Compare
3be662e to
38794ad
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.
Looking good! I verified all ten of Tyler's earlier findings against the branch: the parameterized DenseCaptionMetric with its own compute_instance and disabled fallback, the removed try/except in the judge, the cache directory derived from DENSE_CAPTION_EVAL_DIR, both prompt fields in TaskConfig.to_dict with the hash test, lazy image references plus _result_request, the ValueError on unknown styles, the num_samples > 1 rejection, and the raw display format. The two parity-preserving decisions on the "Not Stated" regex and partial judge responses are documented in place, which matches how this repo handles bug-compatible ports. Ruff, ty, and the unit suite (2234 passed) are clean locally.
Three things I think should be addressed before merge, then some smaller items.
Blocking
-
src/olmo_eval/evals/vision/scoring/judges.py:286
DenseCaptionJudgeScorer.cache_diris a dataclass field, andMetric.to_dictserializes scorer instances withasdict, so the cache path is part of the task hash. I reproduced it:dense_captionhashes tob55f93d3...by default and7eeccc5e...withDENSE_CAPTION_EVAL_DIR=/tmp/x. The same eval on Weka and on a laptop therefore gets different artifact names and different stored configs, whilecache_onlyandrecomputealso leak into the hash. Onlymodelis output-affecting. Please give the scorer ato_dictthat emitstype,name, andmodel, and add a test asserting the hash is independent of the cache settings. The same fix is needed for the CharXiv and MathVista scorers in #323, where the effect is worse. -
src/olmo_eval/evals/vision/data/paths.py:12,benchmarks/dense_caption.py:40,scoring/judges.py:27
Three Weka paths ship as source defaults. Tyler asked in #153 and #276 that runner and task code not carry Ai2 paths; the two options he accepted were a generic default that Ai2 users override at launch, or naming the task as internal and filing a follow-up. The cheapest version here: keep the env vars, drop the Weka literals toNone, and raise a clear error namingMOLMO_DATA_DIR/DENSE_CAPTION_EVAL_DIRwhen they are unset and the data is not found. The Weka values then live in the README and the Beaker launch docs. If you would rather defer, please file the issue and link it from the module docstrings. -
src/olmo_eval/evals/vision/tasks/base.py:33
VisionTask.instancesapplieslimitby taking the first N. Every other task leaveslimitto the runner, which draws a seeded random sample (runners/asynq/preparation.py:60), so-o limit=100means a random sample for text tasks and the first hundred lines for all 25 vision tasks. The dense-caption justification (the raw line index drives the seeded prompt) is specific to that task, and it already applies its own limit. Could the base class drop the slice and let the runner sample, unless prefix-limit is intended for the whole family, in which case the divergence should be documented onVisionTask?
Non-blocking
-
src/olmo_eval/evals/vision/data/images.py:45
load_instance_imageduplicatescommon.images.resolve_imageand has no caller in this PR; its only consumer arrives in #323. Either land it with that consumer or have it delegate toresolve_image. -
src/olmo_eval/evals/vision/benchmarks/dense_caption.py:279
register_variant("dense_caption", "pixmo_cap")registers an alias with no overrides. Variants in this repo describe a format or metric modifier, sodense_caption:pixmo_capreads as if it changes something. Suggest dropping it or documenting why the alias is needed. -
src/olmo_eval/cli/utils.py:130
This hand-maintained allowlist conflicts withmain, which addedstrip_thinkingin #361 (the stack is based four commits behind). #367 proposes deriving the list fromTaskConfig, which would remove the need for this edit entirely. A rebase is needed regardless. -
src/olmo_eval/cli/beaker/launch.py:579
Letting an explicit--secret-envmapping satisfy a required secret is a reasonable change, but it is untested and unrelated to vision. Please add a small test for it. -
src/olmo_eval/evals/vision/benchmarks/dense_caption.py:171
The comment "A missing scorer dependency scores every instance zero rather than failing" is no longer true after the exception-handling fix; anImportErrornow propagates. Please update it so the next reader does not rely on it. -
src/olmo_eval/evals/vision/scoring/prompts.py
_NO_PREFIX_STYLESand_STYLE_PREFIX_STYLESare underscore-private but imported bydense_caption.py. Either export them or give them public names.
Nits
- Nit:
tests/evals/vision/test_prompts.py:62hard-codes/root/mm_olmo; an env var (MM_OLMO_ROOT) would let others run the parity guard. - Nit:
VisionTask.dependencies = ["pillow"]andDenseCaptionEval.dependencies = ["pillow", "openai"]restate the base entry; consider extending rather than replacing.
Before merge
Items 1 through 3 (or, for item 2, a filed follow-up issue and the fail-fast error), plus the rebase from item 6. Then merge once CI is green. Thanks for the careful work on the earlier round.
bafc948 to
5c68033
Compare
|
All nine items addressed in 8586d99 (now based directly on 1 (blocking) — 2 (blocking) — took the deferral path you allowed: the Weka defaults stay (Ai2 launches keep working without three 3 (blocking) — 4 — Nits: the parity guard reads Tyler's ten threads on this PR were all answered with fixes in the previous round and are now marked resolved. Full suite 2,404 passed on this branch; lint/ |
93235c0 to
07fa709
Compare
|
Follow-up on item 7: rather than adding a test for the |
|
Two more trims in a571402: |
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 — this addresses everything from the last round, and the trims make it a much easier PR to read. One suggestion inline that I'd like to land with it.
I re-verified all nine items rather than taking the summary on trust:
- Judge cache out of the task hash.
dense_captionhashes to0cd777dc53b9407eunder the default root,DENSE_CAPTION_EVAL_DIR=/tmp/x, and/tmp/y. It wasb55f93d3.../7eeccc5e...before. limitleft to the runner, so the vision tasks now get the same seeded sample as the text tasks.- Weka paths: the fail-fast error names the variable, and #381 records the literals, the accepted options, and why the interim state is what it is. That's the deferral I offered, done properly.
- Items 4, 5, 8, 9 and both nits all check out, and dropping the
--secret-envtweak and_result_requestrather than testing them was the right call —cli/andrunners/are byte-identical tomainnow.
Locally: 2385 passed, 25 skipped; ruff, format and ty clean. CI is green.
Before merge
src/olmo_eval/evals/tasks/common/base.py:305 — to_dict emits prompt_templates and system_prompt_style unconditionally, so None enters the hashed JSON for every task in the repo and every existing task hash changes. Against main at 35ecf49e:
| task | main |
this PR |
|---|---|---|
arc_easy |
8738c56690bd51aa |
5c1887295371d1a3 |
gsm8k |
4f68bf90a407205a |
1a55be898c78d3f1 |
hellaswag |
0d3fbae973978310 |
d01e4aba2e1f2523 |
humaneval |
e90fac5e5d166beb |
b6e5ee3150759390 |
drop |
61d76aaf976b7df2 |
ebc7997df6421be7 |
Every stored result stops matching new runs of the same config, and pairwise tooling can't line the two up. This is the convention the comment four lines below already describes for strip_thinking and the judge fields — "emitted only when set so that task hashes of runs without it are unchanged from before the field existed" — so it just needs the same treatment.
I applied the inline suggestion locally to check the cost: all five hashes return to their exact main values, and tests/evals/vision/ still passes 42/42, including TestPromptFamilyTaskIdentity. Both fields default to None even on dense_caption, so setting either one still changes the hash, and nothing about the vision tasks' identity changes. Worth a small regression test asserting a text task's hash is unaffected by the new fields, since nothing currently guards that.
Approving so this isn't gated on me — please push the suggestion (or an equivalent) and merge once CI is green.
|
Thanks — and good catch on the hash regression; that one would have been expensive to notice after the fact. Pushed your suggestion in 5dd87aa. Confirmed independently against
Vision suite 48 passed; the rest of the stack is re-rolled on top and I'll merge once CI is green. |
5dd87aa to
d9c0501
Compare
Second of five PRs splitting #278. Introduces the `evals/vision/` package — tasks / scoring / benchmarks / data, per the layout proposed in review — and lands the first family in it: PixMo-Cap dense captioning, GPT-judge scored. `VisionTask` consolidates the instance caching, limit handling and image-attached request construction that every vision family previously reimplemented; families override only how instances are built and which images attach. Dense caption applies its limit inside instance building so the raw-line index driving its seeded prompt never shifts, which the base's slice then leaves untouched. The prompt-family machinery (mm_olmo's 43 seeded pointing templates, the style prefixes, and the caption templates) lives in `scoring/prompts*`; the judge in `scoring/judges`. Vision scorers are deliberately not re-exported through `common/scorers/__init__.py`: that module is imported by every task via `tasks/common/base.py`, so an eager re-export from `evals.vision` would create a package cycle. Both captioning tasks now declare `required_secrets=("OPENAI_API_KEY",)` — the judge always needed the key, but beaker never mounted it, so remote runs failed at scoring time. Registration mirrors `evals/tasks`: one `from . import vision` in `evals/__init__.py`, with the benchmark imports explicit inside the package. Co-authored-by: Ziqi Gao (Roy) <[email protected]>
…t data roots - DenseCaptionJudgeScorer.to_dict emits only type/name/model, so the cache location and mode no longer enter the task hash (same eval hashed differently per machine before). - VisionTask leaves config.limit to the runner's seeded sample, as text tasks do, instead of a first-N slice; dense caption keeps its own index-stable limit while building. - Missing MOLMO_DATA_DIR / DENSE_CAPTION_EVAL_DIR roots fail fast with the variable named; removal of the Ai2 defaults is tracked in #381. - load_instance_image delegates to the shared resolver; the no-op pixmo_cap alias is gone; the style sets are public names; the --secret-env rule is a tested helper; stale dependency comment fixed; parity guard reads MM_OLMO_ROOT.
CI runners cannot stat under /root, so Path.exists() raised PermissionError at collection instead of skipping.
Requests now carry lazy image references, so nothing heavy is echoed back through the result queue and the strip bought nothing; the runner is untouched again. rebase_data_path has no consumer until the pointing family and moves there.
Unconditional emission put None into the hashed config for every task in the repo, changing every existing task hash (arc_easy 8738c566 -> 5c188729, and so on) so stored results no longer matched new runs of the same config. Follow the convention already used for strip_thinking and the judge fields; setting either field still changes the hash, which the vision identity test covers.
d9c0501 to
fa4c5ad
Compare
Description
Second of five PRs splitting #278 (after #316, now merged). Milestone: the
evals/vision/package exists and its first family — PixMo-Cap dense captioning, GPT-judge scored — runs end to end. Based directly onmain.The
evals/vision/packageRegistration mirrors
evals/tasks: onefrom . import visionline inevals/__init__.py, explicit benchmark imports inside the package.Two amendments to the reviewed layout sketch, for sign-off:
benchmarks/holds flat modules, not per-benchmark directories — 17 of the 19 benchmarks are single files, and shared parsers (mmmu_parsingserves mmmu, mmmu_pro and multi-image) belong inscoring/.common/scorers/__init__.py— that module is imported byevals/tasks/common/base.py(every task in the repo), so an eager re-export fromevals.vision.scoring.*creates a package cycle.VisionTaskImageQATask,PointingTask,MultiImageQATaskandDenseCaptionEvalon the vision branch carried byte-identical instance/request mechanics;VisionTaskconsolidates them. Subclasses implement_build_instancesand optionally_attach_images, which returns lazy references (paths / picklable callables) so the parent process never decodes pixels; providers resolve them at inference time. No runner code is touched.config.limitis left to the runner's seeded random sample, exactly as for text tasks (dense caption applies its own index-stable limit while building, because its seeded prompt depends on the raw line index).Task identity + config
TaskConfig.prompt_templates/system_prompt_styleland here with their first consumer, serialized into_dict(with a test that changing either changes the task hash); the-oallowlist picks them up via main's derived mechanism (Derive the accepted -o task override names from TaskConfig #367)DenseCaptionJudgeScorer.to_dictemits onlytype/name/model— cache location and mode are machine-local and no longer perturb the task hash (test: hash is identical withDENSE_CAPTION_EVAL_DIRredirected)required_secrets=("OPENAI_API_KEY",)on both captioning tasks — beaker never mounted the judge's key before. The launcher resolves it as the user-scoped secret{beaker-username}_OPENAI_API_KEY(existing convention; the launch error names the exactbeaker secret writecommand when it is missing)system_prompt_stylevalues raise;num_samples > 1is rejected (the judge protocol is defined for one sample)Dense-caption metrics + judge
DenseCaptionMetricwhosecompute_instancestores its own field (Nonewhen that judge side is invalid); theavgprimary has no exact per-instance decomposition and stores nothing. Regression tests poison the scorer channel.raw(the viewer no longer renders 40.0 as 4000%)scoring_errorsinstead of silently shrinking the valid-example denominator; only unparseable judge replies are per-example invalidNot Statedregex and scoring only the judge lines returned — both are how every published Molmo2 dense-caption number was producedDENSE_CAPTION_EVAL_DIR($DENSE_CAPTION_EVAL_DIR/gpt4-cache)Ai2 data paths
The Weka defaults behind
MOLMO_DATA_DIR/DENSE_CAPTION_EVAL_DIRremain for now so Ai2 launches need no extra flags, but a missing root now fails fast with the variable named rather than reading a nonexistent path. Their removal per the #153/#276 convention is tracked in #381 (linked from the module docstrings).Verification
MM_OLMO_ROOT, skipped when absent)tycleanReview history
Tyler's 10 findings (per-instance metric storage, exception swallowing, cache dir, task hash, lazy images,
Not Statedparity, partial-response parity, display scale, multi-sample aggregation, style validation) and the review agent's 9 (scorerto_dictvs hash, Weka defaults, runner-side limit,load_instance_imagedelegation,pixmo_capalias, allowlist rebase, the untested--secret-envlauncher tweak — removed rather than tested, stale comment, public style-set names) are all addressed in the current head.Type of Change
Checklist
Part of #278 (tracking). Next: #322 — pointing + counting.