Repository navigation
Multi-image benchmarks, multimodal docs and mm_olmo parity (5/5) - #324
Conversation
3c26121 to
00c7618
Compare
c095cbe to
80f83c8
Compare
80f83c8 to
f18535e
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.
Good to see the framework consolidation finish here; MultiImageQATask overriding only _attach_images is the shape Tyler sketched, and the lazy list loader plus the flattening in resolve_images keeps pixels out of the parent process. Ruff, ty, and the unit suite (2397 passed) pass locally.
Three things to fix before merge. The README is the main deliverable of this PR and it currently gives install and pin instructions that contradict #316.
Blocking
-
src/olmo_eval/evals/vision/tasks/multi_image.py:98and:118
MultiImageCategoryMetricandMultiImageCountBucketMetricinherit the defaultcompute_instanceand so persist the scorer value for every instance, including those outside the category or bucket. I reproduced it: aCountinginstance under the MuirBenchOrderingmetric stores1.0. With 12 MuirBench categories, 14 BLINK subtasks, and 7 MMIU relationships plus 3 count buckets, every per-instance row for these tasks carries dozens of wrong values. Please addcompute_instancereturningNoneoutside scope, disable scorer fallback, and extend the poison-the-scorer-channel regression test. This is the same fix as item 2 on #323. -
README.md:697,:769,:777,:793,:711,:673
The new section disagrees with the code it documents::697saysuv sync --extra hf --extra olmo_coreenables the VLM provider. #316 added a separateolmo_core_vlmextra and declared it conflicting witholmo_core, so this command installs the text extra and the provider fails to import.:769to:777say remote runs must pinprovider.package=https://github.com/allenai/OLMo-core.git@visionor workers die. #316 pins a commit through theolmo_core_vlmextra, and the override text also names an unpinned branch, which the repo avoids.:793placesMultiImageQATaskatevals/tasks/common/multi_image_base.py; it lives atevals/vision/tasks/multi_image.py.:711says two tasks call OpenAI;math_vista,dense_caption,charxiv_descriptive, andcharxiv_reasoningdo, andmolmo2_imageqatherefore needs the key as a suite.:673listsmolmo2_imageqawithout the two CharXiv tasks that #323 put in it.:704documents the Weka path as theMOLMO_DATA_DIRdefault. If #317 keeps the default, fine; if it drops the literal as requested there, this line changes too.
Please also documentOLMO_EVAL_PROVIDER_INIT_TIMEOUTfrom #316 here, since this is the only user-facing page for the multimodal path.
-
Merge conflict
This branch conflicts withmaininsrc/olmo_eval/cli/utils.py(theTASK_CONFIG_FIELDSallowlist gainedstrip_thinkingin #361). The stack needs a rebase onto currentmainbefore any of it merges.
Non-blocking
-
src/olmo_eval/evals/vision/data/images.py:85
load_instance_imageshas no caller in the stack;capped_image_listandresolve_imagescover the multi-image path. Please drop it or wire it in. -
src/olmo_eval/evals/vision/benchmarks/mmiu.py:89
Dataset validation viaassert(len(relationships) == 1,relationship in MMIU_RELATIONSHIPS, andletter == string.ascii_uppercase[ix]in_extract_options). Please raiseValueErrorwith the row so a bad record is diagnosable and the check survives-O. -
src/olmo_eval/evals/vision/scoring/multi_image.py:64
Third copy of_response_text(see #322 item 4). -
Follow-up issues
The description promises issues forResponseBatchScorer, provider decomposition,RuntimeRequirements, andImageReferenceonce this merges. Tyler's habit was to have those filed before the merge so they are linked from the PR; please open them now and link them here.
Nits
- Nit:
multi_image.py:56replace_imagesdefinesreplinside the loop; hoisting it with the counter in a small closure or class would read more clearly. - Nit:
mmiu.pyrelationships = list({...})builds a set and then asserts it has one element;{path.split("/")[1] for ...}with a length check is enough.
Before merge
Items 1 through 3. Then merge once CI is green, and please post the follow-up issue links from item 7 on #278 as planned.
49705ba to
4202578
Compare
4202578 to
91bbb84
Compare
Last of five PRs splitting #278. MuirBench, MMIU and BLINK, scored by the mm_olmo MuirBenchEval-family protocol (option-letter accuracy over an image list), and the README's Multimodal Evaluation section updated for the `evals/vision` layout. `MultiImageQATask` completes the VisionTask consolidation: it overrides only `_attach_images` (an image list capped at mm_olmo's eval-time 20) rather than carrying its own request construction. The list-image lazy loaders join the single-image ones in `vision/data/images`. Co-authored-by: Ziqi Gao (Roy) <[email protected]>
- MultiImageCategoryMetric and MultiImageCountBucketMetric implement compute_instance and disable scorer fallback, so a Counting instance no longer persists 1.0 under MuirBench's Ordering metric. With 12 MuirBench categories, 14 BLINK subtasks and 7 MMIU relationships plus 3 count buckets, that was dozens of wrong values on every per-instance row. - MMIU's dataset validation raises ValueError naming the offending row instead of asserting (asserts are stripped under -O), and the relationship check drops the list-of-a-set round trip. - The third copy of the response-text helper is gone, as are the last mid-module imports and their E402 suppressions. - load_instance_images had no caller; capped_image_list plus resolve_images cover the multi-image path. - resolve_images flattens list entries and drops empty slots at both levels, which the variable-image-count benchmarks need. - README: the missing-data-root behavior, and the follow-ups are filed as #392 (ResponseBatchScorer), #393 (provider decomposition), #394 (RuntimeRequirements) and #395 (ImageReference).
One closure over the shared counter numbers the question and every option in order, exactly as before.
The metric families read one output per example and mm_olmo scores a single greedy sample, so the check dense_caption carried now lives in VisionTask.
Request records spread instance.metadata into the document, and the vision tasks keep picklable image loaders there. json.dumps raised on the first one, leaving requests.jsonl empty; such values now serialize as a type placeholder.
- pixmo_points_eval[_mp]: the 149 absent-phrase examples have no mask to take the image size from, so image_size was None and the scorer rejected them. Their size now comes from the image header. - judges.py defined _cache_key twice; CharXiv's later definition shadowed the dense-caption one, so the caption judge never hit the shared gpt4-cache/. CharXiv's helper is renamed, and a test pins the legacy key.
The suite now re-scores every mm_olmo Molmo2-4B dump that exists for the benchmarks in this stack: PixMo-Points (plain and _mp), SA-Co gold 4k and both subsets, MuirBench, BLINK, MMIU, and the mp0816 dense captions through the judge cache.
mm_olmo's judge script races its recall and consistency threads on the canonical-statement cache entry, so recall reproduces exactly from the shared cache while only the rest of the consistency judgments can be rebuilt. MMMU's maintainers edited three Art_Theory questions after the reference dump.
The VLM provider raised on a prompt longer than max_length, which fails every request in the runner's batch: on Molmo2-4B mmmu_pro, 2 over-long prompts cost 48 instances. The provider now marks just that request's output, and the runner records a marked request as a failed instance instead of scoring it.
eval_molmo2.py evaluates the released Molmo2 models at 24 crops while the provider defaults to the checkpoint's training value; on Molmo2-4B document QA is 6-7 points lower at 8. Also fix ImageQATask's module path.
eval_molmo2.py also runs at a 64,000-token sequence, and multi-image prompts keep 8 crops per image. At the checkpoint's 16,384 about 3.5% of MMIU prompts are too long; at 64,000 a 512-instance MMIU sample scores 0.5527 against mm_olmo's 0.5547 on the same instances.
The VLM provider's window now defaults to 64,000 tokens (or the checkpoint's, if longer), the length mm_olmo's eval_molmo2.py uses. At the checkpoint's 16,384 about 3.5% of MMIU prompts failed, all of them 11-20-image examples (18.8% of that bucket), and failed instances leave the metric denominator. Both multimodal providers crop each image of a multi-image prompt to max_multi_image_crops (the checkpoint's, else Molmo2's 8), as mm_olmo does; the HF preset's 24 crops now apply to single images only.
Only request records carry lazy image loaders, so only the requests writer replaces callables with a placeholder; every other non-JSON value still raises in both writers.
BLINK and MMIU load at the Hub revisions the parity checks ran on. BLINK and MuirBench raise ValueError on an unknown category, and MMIU checks its ./<relationship>/ image layout instead of assuming it.
Covers response stripping and option scoring, replace_images, MMIU option and path parsing, the image-count bucket boundaries, the pixmo absent-phrase image size, and the chat-path request-error marker.
The test stubs the dataset, so it must not consult the multimodal data root, which CI does not have.
6a5f1ce to
569bbb1
Compare
|
Both blocking items and all the smaller ones are addressed (the five commits ending at 569bbb1, rebased onto current 1 (blocking) — the per-bucket counts at 16,384, from the seeded 512-instance MMIU sample: 2 (blocking) — handled in the providers rather than the docs: both multimodal providers crop each image of a multi-image prompt to 3 — the fallback is now only on the requests writer and only for callables ( 4 — always-on tests added: 5 — BLINK and MMIU are pinned to the Hub revisions the parity checks ran on ( Nits: BLINK and MuirBench raise Full suite 2,811 passed (also with no data root); lint/format/ |
|
The live HF |
…= 5.9 modeling_molmo2.py calls create_causal_mask and create_masks_for_generate with input_embeds and cache_position. transformers 5.9 removed the input_embeds deprecation shim from both and create_causal_mask's cache_position parameter, so every HF-provider Molmo2 forward raised TypeError (Beaker resolves 5.12.1 unlocked). The multimodal load path now wraps both helpers, renaming or dropping the kwargs the installed signature lacks; a pass-through on 5.8. Verified on CPU with 5.8.1 and 5.12.1, same outputs.
|
The live HF check ran after all, on an H100 from c7c5a8c (https://beaker.org/ex/01M3DW5F1839NG9PRKC32B2H85): |
Description
Last of five PRs splitting #278 (#316, #317, #322 and #323 are merged). It adds the multi-image family and the multimodal README, and it closes the stack with a parity pass. The final code has to reproduce both the
visionbranch and mm_olmo on every benchmark the stack added. That pass found four faults in code already onmain, and they are fixed here, along with two defaults the second review showed were hiding results.Multi-image benchmarks
muir_bench (2,600), mmiu (11,698) and blink (1,901). Each instance carries an image list and is scored with mm_olmo's MuirBenchEval-family protocol (option-letter accuracy, plus per-category and MMIU image-count buckets). Suite:
molmo2_multiimage.MultiImageQATaskoverrides only_attach_images(lists capped at mm_olmo's eval-timemax_images=20); caching, limits and request construction come fromVisionTask.Noneoutside their scope, with scorer fallback disabled.MOLMO_DATA_DIR,OPENAI_API_KEY, run commands, both providers and task authoring.Fixes to code already on
main(found by the parity pass)pixmo_points_eval[_mp]: the 149 absent-phrase examples (of 1,215) have no mask to read the image size from, soimage_sizewasNoneand the scorer rejected them. Their size now comes from the image header.judges.pydefined_cache_keytwice. CharXiv's later definition shadowed the dense-caption one, so the caption judge never hit the sharedgpt4-cache/and re-paid for every GPT-4o call. CharXiv's helper is renamed, and a test pins the legacy key.max_length, and the runner fails every request in a batch that raises. On Molmo2-4B mmmu_pro, 2 over-long prompts cost 48 instances. The provider now marks only that request (REQUEST_ERROR_KEYininference/errors.py), and the runner records a marked request as a failed instance, which is the per-instance failure the Multimodal eval (1/5): image requests, HF VLM path, OLMo-core VLM provider #316 review asked for. Other providers never set the marker, so nothing changes for them.eval_molmo2.pyevaluates at. At the checkpoint's 16,384, about 3.5% of MMIU prompts exceeded the window; all of them are 11–20-image examples (18.8% of that bucket, 18 of 96 in a seeded 512 sample), and failed instances leave the metric denominator, soalland that bucket were quietly reported over the rest. Only prompts longer than the training window see the change: they are answered, as mm_olmo answers them.max_multi_image_crops(the checkpoint's, else Molmo2's 8) in both multimodal providers, as mm_olmo does. The README'smolmo2-4bHF preset previously applied its 24 single-image crops to every image of a multi-image prompt.modeling_molmo2.pypassesinput_embedsandcache_positiontocreate_causal_mask/create_masks_for_generate, and 5.9 removed theinput_embedsshim and thecache_positionparameter, so every forward raisedTypeError. Beaker installs unlocked and resolved 5.12.1. The multimodal load path now wraps both helpers, following the provider's existing compat shims; a pass-through on 5.8 (verified on CPU with 5.8.1 and 5.12.1: identical outputs).requests.jsonlcame out empty for vision tasks: lazy image loaders ininstance.metadatamadejson.dumpsraise, and the runner swallowed the error. Both JSONL writers now write non-JSON values as a type placeholder (partial fix of ImageReference: make image laziness a declared contract #395).num_samples > 1is rejected for every vision task, not justdense_caption.replace_imagesbuilds its callback once, outside the loop.Parity
vs mm_olmo: re-scoring the released Molmo2-4B prediction dumps
tests/evals/vision/test_dump_parity.py(opt-in,RUN_DUMP_PARITY_TESTS=1) re-scores every mm_olmo dump that exists for these benchmarks with this stack's tasks, scorers and metrics. It checks prompts row by row and every reported metric. 22 passed, 1 opt-in skipped (MathVista GPT extraction, which needs ~1,000 API calls).*-validation/-testmmmu_test-validationmath_vista_v2-validationpixmo_point_eval_v3.1-testpixmo_point_eval_v3.1-test-mp0816sa-co-gold-v4-test-mp0816(28,672)sa-co-gold-subset-v3-testsa-co-gold-subset-v4-testmuir_bench-testblink-validationall+0.0005; bounded by guesses (below)mmiu-testall+0.0002; bounded by guesses (below)dense_caption_eval-test-mp0816mmmu_pro and CharXiv have no mm_olmo dump (mm_olmo has no CharXiv). They are covered by the vision-branch comparison below.
Every residual is explained:
randomstream and the port seeds the guess per instance (360 and 10 rows). The test requires every metric to match on the other rows and to stay within the number of guesses. muir_bench has no guesses and is exact.vs mm_olmo
maintoday_mp) pointing queries dropped the trailing period, andSACoGoldSubsetreads the v2 file._mpprompts are unchanged.PixMoPointsEval3Confignow defaults to v3.2 /GroundingEvaluatorV5(Port mm_olmo's GroundingEvaluatorV5 and the balanced SA-Co v5 benchmark #402). On mm_olmo's own V5 dump, f1 is +0.0015 here, all from 8 responses truncated at the token limit (details on Port mm_olmo's GroundingEvaluatorV5 and the balanced SA-Co v5 benchmark #402).eval_captioner.sh's loader seed (6198).eval_molmo2.pyuses 691203; the test checks the template choice at both.vs the
visionbranch: Beaker, Molmo2-4B/step2000Both sides ran on Molmo2-4B/step2000 on the same GPU type (B300) and the same OLMo-core commit (
2dad929a): this stack withprovider.kind=olmo_core_vlm, andvisionwithprovider.kind=olmo_corepinned to that commit. Beaker groupmolmo2-parity-final.limitsamples differently in the two trees (below)Why a few generations differ. Instances and requests are identical for every example (checked by hashing both trees' instances, requests and gold). The stack is deterministic: a repeat run matched it byte for byte on all 17,050 image-QA generations. Every difference traces to batch composition. The vision branch's runner sometimes closes a 64-item chunk early (its 5 s chunk timeout; 62 items at batch 73 in the image-QA job, 22 at batch 40 in the pointing job, 13 at batch 40 in the SA-Co 4k job, 8 short chunks in the caption job), which shifts every later batch boundary. A different batch mix changes the left-padding, and bf16 then tips a few near-tied tokens. The stack filled every chunk. Wherever both runs formed the same batches (counting, ai2d, vqa2, mmmu, real_world_qa, math_vista, CharXiv, muir_bench, and the first 72 image-QA batches), the generations are byte-identical.
Reproducing mm_olmo's published numbers
The provider uses the checkpoint's training
max_crops(8 for Molmo2-4B), as the vision branch does, while mm_olmo'seval_molmo2.pyevaluates the released models at 24 crops per single image; document QA is very crop-sensitive. The window (64,000 tokens) and the multi-image crops (8 per image) now default to mm_olmo's values, which also accounts for the MMIU gap left unexplained in the August vision-branch runs (those prompts were scored empty). At-o provider.max_crops=24, this stack lands within 0.006 of mm_olmo'smetrics.jsonon every benchmark with a reference (dense caption within 0.08 on its 0–100 scale). At 24 crops, 94–99% of the image-QA generations are byte-identical to mm_olmo's own predictions (doc_qa 97.9%, up from 69.6% at 8 crops). The multi-image rows use the regular run, since mm_olmo also uses 8 crops for multi-image:molmo2-4bpreset on H100 (24 single-image / 8 multi-image crops, with the transformers shim)limitis not comparable across the trees: the vision branch's multi-image tasks keep the first N instances, whileVisionTaskhandslimitto the runner's seeded random sample like every text task. The MMIU row is therefore that random sample, compared with mm_olmo's dump predictions for the same 512 instances (503/512 pick the same answer letter).The remaining gap is model-runtime drift (OLMo-core on B300 vs mm_olmo on H100). The dump-parity suite above shows that the eval code itself reproduces mm_olmo exactly. The README now documents both settings.
Issues
ImageReferencedesign stays open there); thenum_samplesfollow-up from Pointing + counting benchmarks (3/5) #322; HF Molmo2 path fails on transformers 5.12: create_causal_mask() rejects input_embeds #416 (HF Molmo2 path on transformers ≥ 5.9).ResponseBatchScorer): batching CharXiv's grader would change its scores relative to the vision branch, and mm_olmo has no CharXiv to arbitrate.Follow-up links are on #278.
Verification
tyclean.main(all 581 tasks);blink,mmiuandmuir_benchare the only new tasks.pyproject.toml/uv.lockuntouched).test_prompts.py) passes against mm_olmomainat f2b61c1a.olmo-eval run -m mock -t muir_bench -o limit=3writes all 3 request records (0 before the writer fix).Type of Change
Checklist
Part of #278 (tracking).