Skip to content

Add multimodal evaluation - #278

Closed
jason718 wants to merge 26 commits into
mainfrom
vision
Closed

jason718 wants to merge 26 commits into
mainfrom
vision

Conversation

@jason718

@jason718 jason718 commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds multimodal (vision-language) evaluation to olmo-eval: 25 image tasks across five families, 5 suites, and two VLM inference paths. Everything is aligned to the mm_olmo reference implementation and verified numerically against it — see Results.

The task/harness/provider split is unchanged: image tasks attach images to LMRequest.images, and the provider decides how to render them. No changes to the text-only evaluation paths beyond the shared provider files.

Tasks

Family Suite Tasks
Image-QA molmo2_imageqa chart_qa, vqa2, doc_qa, info_qa, text_vqa, real_world_qa, mmmu, mmmu_pro, math_vista, countbench_qa, pixmo_count, ai2d, charxiv_descriptive, charxiv_reasoning
Dense caption molmo2_imageqa_caption the above plus dense_caption (GPT-4o recall+consistency judge); dense_caption_captioner for style_and_length_v2 captioner checkpoints
Pointing molmo2_pointing pixmo_points_eval, sa_co_gold_subset
Pointing (_mp) molmo2_pointing_mp pixmo_points_eval_mp, sa_co_gold_subset_mp, sa_co_gold_point_4k_mp (+ sa_co_gold_point_mp, registered but outside the suite)
Multi-image molmo2_multiimage muir_bench, mmiu, blink

Image-QA primaries are all 0-1 so the suite averages them; dense_caption reports 0-100, so molmo2_imageqa_caption is display-only. Pointing scores point-in-mask precision/recall/f1 by maximum bipartite matching rather than VQA-style answers, which is why it is a separate family.

mmmu_pro is deliberately decoupled from mmmu — its own prompts, parser and scorer, faithful to the official mmmu-pro repo. One task covers all three official settings and emits the SOTA-reported overall = (standard-10 + vision)/2.

Prompting follows the checkpoint

mm_olmo's DataFormatter builds the prompt from two settings recorded in each checkpoint's own config, so the same benchmark asks different things of different models:

  • prompt_templates — none uses the bare lowercased label; uber_model_v2 samples one of 43 templates, seeded per example.
  • system_prompt — demo_or_style_v2 adds nothing; style_and_length_v2 prefixes the style ("pointing: ", "point_count: ").

common/pointing_prompts.py reproduces both, including mm_olmo's exact per-example RNG (RandomState((691203*195172 + idx) % (2**32-1))). The _mp task variants route the bare label through it; the pre-built-question benchmarks apply the style prefix via StylePrefixMixin. Defaults are unchanged (demo_or_style_v2 adds no prefix), so only an explicit -o system_prompt_style=style_and_length* alters existing runs.

This matters: on a stage-1 checkpoint the mismatch cost dense_caption 7.1 recall points and turned 3.4% of caption answers into <points .../> markup.

Inference

HuggingFaceProvider gains an image-text-to-text path: AutoProcessor + AutoModelForImageTextToText, transformers-5 load shims for Molmo2 remote code, fp32-weights/bf16-autocast to match mm_olmo's amp_bf16 numerics, and pickle-safe lazy image decode. It also loads consolidated OLMo-core exports directly.

olmo_core_vlm is a new provider for OLMo-core MultimodalLM checkpoints in three on-disk formats: raw trainer saves, consolidated safetensors exports, and mm_olmo trainer checkpoints (config-translated and key-remapped at load). It drives its own decode loop with batched variable-length KV-cached decoding, since OLMo-core's vision branch has no multimodal generation module. -m with provider.kind=olmo_core auto-detects multimodal checkpoints.


Running it

uv sync --extra hf                    # HF multimodal path
uv sync --extra hf --extra olmo_core  # + OLMo-core MultimodalLM checkpoints

export MOLMO_DATA_DIR=/weka/oe-training-default/mm-olmo   # read-only; loaders raise rather than build caches
export OPENAI_API_KEY=...                                 # dense_caption, charxiv, math_vista judges

uv run olmo-eval run -m molmo2-4b -t molmo2_imageqa
uv run olmo-eval suite inspect molmo2_pointing_mp

For an OLMo-core checkpoint, force the provider and pass the checkpoint's prompt family:

uv run olmo-eval run --harness default -o provider.kind=olmo_core \
    -m /weka/path/to/stepN \
    -t pixmo_points_eval_mp -o prompt_templates=none -o system_prompt_style=style_and_length_v2

math_vista:offline avoids the OpenAI dependency. Full end-user docs are in the README under Multimodal Evaluation.


Results

Verified against mm_olmo on Molmo2-4B (fp32 + bf16 autocast, max_crops=24).

_mp pointing, reproducing mm_olmo runs of the same protocol — prompts byte-identical (3856/3856 and 1215/1215):

Benchmark this PR mm_olmo Δ
sa_co_gold_subset_mp (4B-Pretrain) 0.6631 0.6658 −0.0027
pixmo_points_eval_mp (4B-Pretrain) 0.8152 0.8083 +0.0069

Original pointing / image-QA parity: SACoGold weighted f1 0.6909 vs 0.6922 (all 18 metrics within 0.0025); PixMo-Points f1 0.8314 vs 0.8290. MMMU-Pro full run (5190 ex): overall 26.01 (standard-10 35.20 / standard-4 44.62 / vision 16.82).

Exactness checks: prompt construction token-exact with the released Molmo2 processor (765/765 input_ids); the OLMo-core → Molmo2 weight conversion bit-exact against an independently converted twin (706/706 tensors); KV-cached decoding token-for-token identical to no-cache decoding.


Bugs this surfaced

Running real OLMo-core multimodal checkpoints end-to-end exposed several latent defects, each fixed here:

Bug Symptom
_embed ignored split-vocab extra_weight CUDA device-side assert on every image token
flex-attention checkpoints couldn't carry a KV cache 30× slowdown (425s → 14s / 4 examples)
image tasks never declared pillow all 19 image tasks failed on Beaker
tqdm lazy-lock race in parallel task prep nondeterministic task failure
provider-init timeout hardcoded at 900s every worker timed out under concurrent checkpoint loads
pointing/judge scorer deps undeclared silent 0.0000 with status Success
mm_olmo untied LM head silently tied to embeddings Molmo2-8B scored 0.12 vs 0.83 on pixmo, never emitting EOS

The two silent ones are worth review attention: a task whose every instance fails to score is currently indistinguishable from one that legitimately scored zero, and the LM-head substitution loaded and ran without error.

Type of Change

  • New feature (non-breaking change that adds functionality)
  • Bug fix (non-breaking change that fixes an issue)

Testing

  • Unit tests pass locally (pytest tests/ --ignore=tests/integration/) — 2054 passed, 9 skipped
  • New tests added — all CPU-only, no GPU or network: multimodal provider paths, image-QA request/prompt parity vs reference dumps, scoring, MMMU-Pro parser, pointing geometry and metrics, mm_olmo prompt-parity guard, and the mm_olmo key remap
  • Instance counts verified against mm_olmo for every task added
  • Lint + format clean; ty clean under CI's --no-group vllm

Integration-level verification (real checkpoints, real data) was done out-of-band against mm_olmo — see Results.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have added/updated documentation as needed — README Multimodal Evaluation section
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

uwGZQ and others added 9 commits June 23, 2026 06:56
Lint (ruff):
- Remove unused imports (asyncio/json/Path in test_dense_caption_judge,
  abc.abstractmethod in dense_caption) and fix import ordering.
- Replace if/else with a ternary (SIM108) and wrap two over-length
  logger.warning calls in dense_caption_judge.

Type check (ty):
- Declare metric/scorer name and scorer as plain dataclass fields instead
  of ClassVar, matching the Metric/Scorer base classes (fixes the
  invalid-attribute-override errors across image_qa, dense_caption, and
  dense_caption_judge).
- vqa_normalization: type _argmin as Sequence[float] (list invariance),
  guard the regex match / float parse against None before use.
- image_qa: _default_gpt_cache_dir always returns str.
- countbench_qa: coerce question to str.
- vqa2: ignore the np RandomState.shuffle ArrayLike mismatch (the seeded
  list shuffle must match mm_olmo for dump parity).

No behavior change; offline scorer/caption/pipeline tests still pass.
* new vision tasks

* Add Molmo2-4B image-QA + PixMo-Cap dense-caption eval support

Evaluate the released HF allenai/Molmo2-4B (11 image-QA benchmarks +
PixMo-Cap dense caption) inside olmo-eval, aligned to the mm_olmo
reference. No uv env / version changes beyond declaring Molmo2 remote-code
deps (einops, torchvision) in the existing `hf` extra.

- huggingface provider: transformers-5 load shims for Molmo2 remote code
  (strip optional-attribute processor kwargs; recover generation
  cache_position) + fp32-weights/bf16-autocast path (autocast_dtype) to
  match mm_olmo's amp_bf16 numerics; pickle-safe lazy HF image decode.
- molmo2-4b preset: dtype=float32 + autocast_dtype=bfloat16, max_crops=24.
- math_vista: default to the official gpt-4-0613 extraction; add
  math_vista:offline for the API-free heuristic.
- dense_caption: faithful per-example seeded long_caption prompt (23
  templates) instead of a single hardcoded question; auto-create GPT cache.
- ai2d: add the transparent-label variant alongside opaque (primary).
- evals/suites/molmo2.py: molmo2_imageqa (11) + molmo2_imageqa_caption (12).
- tests for the multimodal provider, image-QA requests, and prompt parity.

* Add image-pointing eval family (PixMo-Points-Eval v3 + SACoGold)

Adds a separate image-pointing eval family for the released HF Molmo2-4B,
distinct from the 11 image-QA tasks (its own base class, scorer, metrics,
suite, and doc; the image-QA modules are untouched). Ports two mm_olmo
benchmarks run on the HF checkpoint:

- pixmo_points_eval  (mm_olmo PixMoPointsEval3Config / SegmentionPointingEval)
- sa_co_gold_subset  (mm_olmo SACoGoldSubset / SACoGoldPointEvaluator)

Both ask "Point to <thing>." and score point-in-mask precision/recall/f1 by
maximum bipartite matching, bucketed by GT instance count; SACoGold takes the
max over 3 annotators with weighted primaries. New modules: common/pointing.py
(COCO-RLE mask decode + bipartite scoring), common/scorers/pointing.py,
evals/tasks/common/pointing_base.py (PointingTask + PointingMetric +
pointing_metrics), the two task modules, the molmo2_pointing suite, and
CPU-only tests. pycocotools (+ explicit scipy) added to the hf extra; the
uv.lock diff is only pycocotools. Reuses generic helpers by import only.

Verified vs mm_olmo (Molmo2-4B, fp32+bf16 autocast, max_crops=24):
SACoGold weighted f1 0.6909 vs 0.6922 (all 18 metrics within 0.0025);
PixMo-Points f1 0.8314 vs 0.8290. Full suite: 1755 passed, 5 skipped.
A single `mmmu_pro` task evaluates the released HF Molmo2-4B on all three
official MMMU-Pro settings (standard 10-option, standard 4-option, vision) and
emits one metrics.json with standard_10_accuracy, standard_4_accuracy,
vision_accuracy and the primary `overall` = (standard-10 + vision)/2 (the
SOTA-reported number).

Decoupled from the existing `mmmu` task — its own prompts/parser/scorer,
faithful to the official MMMU-Benchmark/MMMU mmmu-pro repo:
- common/image_qa/mmmu_pro.py: verbatim direct prompts; replace_images_tokens
  (interleaved images attached in <image i> token-appearance order, not key
  order, since options are shuffled); official raw-response answer parser
  (rfind "Answer:" then (A)/"A "/"A."/option-text), MC-only, seeded fallback.
- common/scorers/mmmu_pro.py: MmmuProScorer (raw response, no clean_prediction).
- evals/tasks/mmmu_pro.py: the task (3 settings interleaved), per-setting +
  overall metrics, multi/single-image format_request.
- evals/suites/molmo2.py: "mmmu_pro" added to MOLMO2_IMAGE_QA_TASKS (its overall
  counts as one 0-1 entry, like the other image-QA benchmarks).
- tests/evals/tasks/test_mmmu_pro.py: parser ladder, image-order, prompts,
  metrics, request (CPU-only).

Verified: full suite 1773 passed; full Molmo2-4B run (5190 ex) overall 26.01%
(standard-10 35.20 / standard-4 44.62 / vision 16.82).


Claude-Session: https://claude.ai/code/session_017rWjjwFXMM556pd4ixrQ96

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
…der) (#245)

- New `olmo_core_vlm` provider runs OLMo-core MultimodalLM checkpoints in
  three on-disk formats: raw OLMo-core trainer saves (config.json +
  model_and_optim DCP), consolidated safetensors exports (olmo-core key
  names), and mm_olmo (video_olmo) trainer checkpoints, which are
  config-translated and key-remapped at load time via OLMo-core's molmo2
  loader. Prompt construction is token-exact with the released Molmo2
  processor (verified 765/765 input_ids); decoding uses a KV-cache-capable
  dense-SDPA backend subclass (the stock torch/flex backends reject caching)
  with token-for-token parity against no-cache decoding, plus over-length
  clamping and a decode lock for the async harness.

- HuggingFaceProvider now also loads consolidated OLMo-core exports:
  auto-detected, weights converted in-memory to the released Molmo2-4B
  layout (bit-exact inverse of OLMo-core's HF loader mapping; verified
  706/706 tensors against an independently converted twin), with
  config/processor borrowed from a reference repo (`reference_model` kwarg
  or the export's recorded model_id). End-to-end greedy output matches the
  released-format checkpoint word-for-word.

- Dense-caption conformance fixes vs mm_olmo: seeded prompts now use the
  dense-caption pipeline's loader seed 6198 (launch_scripts/eval.py,
  verified against a real DenseCaptionEval-test dump's _getter_seed;
  pixmo_count keeps 691203), `num_statements` reports the consistency-side
  canonical-statement count (mm_olmo's ConsistencyEval semantics), and a
  new `dense_caption_captioner` task covers style_and_length_v2 captioner
  checkpoints (constant "long_caption 65:" prompt, verified verbatim).

Full non-integration suite: 1795 passed, 5 skipped.
Resolve the HuggingFaceProvider.generate conflict by keeping both sides:
main's warning for the unsupported truncate_prompt_tokens/truncation_side
params now fires before the multimodal dispatch, so it applies to both
paths. The multimodal path also builds its generate kwargs per request so
main's prompt-length-aware max_new_tokens budget applies there too.

Regenerate uv.lock instead of taking the textual auto-merge, which mixed
both sides' extra markers and resolved numpy to two versions at once.
`AutoTokenizer.from_pretrained` returns a union that includes `None`, so
every `self.tokenizer` access in the VLM provider was unresolved, and
`convert_tokens_to_ids` / `decode` widened to unions that then failed at
their call sites. Declare the tokenizer surface the provider needs as a
protocol extending the text provider's `TokenizerProtocol`, matching how
`OlmoCoreProvider` already types its tokenizer.

Also narrow the fused QKV bias list before `torch.cat` instead of
suppressing the argument type, which drops a `# type: ignore` that `ty`
does not honor anyway.
Adds a Multimodal Evaluation section covering the three image task
families and their suites, the `hf` / `olmo_core` extras, the read-only
MOLMO_DATA_DIR tree and OPENAI_API_KEY requirements, run commands, the
two provider paths, and how to add a multimodal task.
@uwGZQ
uwGZQ marked this pull request as draft August 13, 2026 02:17
uwGZQ added 4 commits August 13, 2026 03:14
… decoding

- Process requests in batches (batch_size kwarg, default 16, None = whole
  chunk): left-padded batched prefill with per-row explicit-position RoPE,
  KV-cached decode with per-row cache-leftpad masking, and per-row
  stop/budget tracking. The vision tower still runs once per request, so
  image features match single-request processing exactly; batch_size=1
  reproduces the previous sequential outputs byte-for-byte.
- Normalize checkpoint attention configs to the dense torch backend at load
  (attention_backend kwarg): training configs pin flex/flash_2, which cannot
  KV-cache the bidirectional image or_mask, silently forcing quadratic
  full-re-forward decoding. Escalate the no-cache fallback log to error.
- Mask extra-vocab (image-special) logits at token selection: the released
  architecture has no lm_head rows for these input-only ids, but the
  OLMo-core layout keeps zero/noise rows that outscore real tokens on
  diffuse distributions, hijacking generation into empty outputs.
- Support max_tokens=None (generate to the model's context limit) and reject
  tensor_parallel_size != 1 instead of silently ignoring it.
- Flow unknown dotted CLI overrides (-o provider.batch_size=8) into provider
  kwargs instead of silently dropping them.

Verified on A100: RealWorldQA-64 on an mm_olmo checkpoint 62.6s -> 15.0s
(batch 16; batch 1 byte-identical to the old loop); a flex-pinned raw
OLMo-core DCP checkpoint 598.8s -> 4.0s for 8 samples.
Ports mm_olmo's multi_image task family (muir_bench:test, mmiu:test,
blink:validation) as its own task family with the molmo2_multiimage suite:
MultiImageQATask base (max_images=20 cap, <image> -> "Image n" rewriting,
category/count-bucket metrics), multi-image MC response stripping and
scoring (reusing the MMMU letter parser, with a deterministic per-example
fallback for unparseable answers), and MultiImageMcScorer.

Prompt parity verified against the Molmo2-4B reference prediction dumps:
0 mismatches across all 16,199 examples; metrics match exactly on every
parse-deterministic category, with residual deltas confined to the
random-fallback examples.
Narrow the left-pad token id to int (raise if the tokenizer defines neither
pad_token_id nor eos_token_id) so torch.full sees a concrete fill value, and
type the explicit-position cache manager's current_position override as Any
instead of an ignore directive ty does not honor.
@uwGZQ
uwGZQ marked this pull request as ready for review August 13, 2026 13:50
@jason718
jason718 requested a review from undfined August 13, 2026 15:27
@jason718 jason718 added the enhancement New feature or request label Aug 13, 2026
@undfined

undfined commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Some high level thoughts before we decompose this a bit.

  1. We probably want a cleaner package layout for vision stuff. Maybe roughly something like this:
evals/vision/
├── tasks/
│   ├── base.py
│   ├── single_image.py
│   ├── multi_image.py
│   └── pointing.py
├── scoring/
│   ├── vqa.py
│   ├── multiple_choice.py
│   ├── pointing.py
│   └── judges.py
├── benchmarks/
│   ├── charxiv/
│   ├── mmmu/
│   └── ...
└── data/
    ├── images.py
    └── paths.py
  1. Can we add an abstraction for handling batch scoring instead of overriding behavior for charxiv? I think something roughly like this could be cleaner if it's not too onerous:
class ResponseBatchScorer:
    async def score_responses(
        self,
        responses: Sequence[Response],
        context: ScoringContext,
    ) -> None: ...
  1. Provider classes have a lot of responsibilities. Let's try to decompose them a bit (olmo-core vl in particular) maybe something like:
inference/providers/olmo_core_vlm/
├── provider.py
├── checkpoint.py
├── conversion.py
├── preprocessing.py
├── generation.py
└── cache.py
  1. (From Sol, can be a follow up possibly but might make your life easier) Runtime requirements should be declarative
    The branch has several kinds of requirements:
    Python packages.
    Model/provider capabilities.
    Local benchmark data.
    External API credentials.
    Judge caches.
    GPU/runtime requirements.
    These are currently spread among optional dependencies, task docstrings, environment-variable reads, provider presets, and README instructions.
    Tasks and providers could expose structured requirements that can be validated before launching:
RuntimeRequirements(
    packages=(...),
    secrets=(...),
    data_paths=(...),
    capabilities=("images", "multi_image"),
)

This would let the CLI fail during planning rather than during dataset loading or scoring. It would also make suite requirements computable from their constituent tasks.

  1. Consider consolidating class construction into some sort of base class for the vision task classes:
    ImageQATask, MultiImageQATask, PointingTask, and DenseCaptionEval each implement similar mechanics for caching things, applying limits, resolving lazy images, constructing chat requests, and attaching image inputs.
    Maybe something like:
class ImageTask(Task):
    def build_instances(self) -> Iterator[Instance]: ...
    def resolve_images(self, instance: Instance) -> tuple[Image, ...]: ...
    def format_messages(self, instance: Instance) -> tuple[Message, ...]: ...
  1. Consider something like the following so that we centralize how we describe image references:
class ImageReference(ABC):
    """A lazily resolved reference to an image."""

    @abstractmethod
    def load(self) -> Image.Image:
        """Load and return the referenced image."""

    @abstractmethod
    def describe(self) -> str:
        """Return a useful source description for logging and errors."""


@dataclass(frozen=True, slots=True)
class PathImageReference(ImageReference):
    path: Path

    def load(self) -> Image.Image:
        return Image.open(self.path)

    def describe(self) -> str:
        return str(self.path)

We can then have different concrete classes like InMemoryImageReference or w/e

jason718 and others added 10 commits August 15, 2026 03:58
Two fixes found running an OLMo-core multimodal stage1 checkpoint:

`_embed` looked up `lm.embeddings.weight` alone, which covers only the
base vocab. Checkpoints trained with extra vocab keep the image special
tokens in a second `extra_weight` parameter, so every image token indexed
out of bounds and the decode died on a device-side assert. Span both
blocks, as `MultimodalLM.forward` already does, and cache the result
since the lookup runs once per decode step.

Checkpoints trained with `OLMO2_FLEX_ATTN=1` record the fused `flex`
attention backend, which cannot carry a KV cache, so decoding silently
fell back to re-running the LM over the whole sequence per token. Use the
dense `torch` backend when caching is requested — it has the same masking
semantics — and log the switch.

Also correct the README multimodal example: `-o` must follow `--harness`
or `-t`, so the provider override needs an explicit `--harness default`.
Keep the new `attention_backend` provider option, which supersedes the
local flex->torch switch: it normalizes every attention config at load
and defaults to the dense backend, covering the flex-trained checkpoints
that motivated the switch.

Re-apply the split-vocab embedding fix on top of the batched decode path:
`_embed` still looked up `lm.embeddings.weight` alone, so checkpoints that
keep image special tokens in `extra_weight` indexed out of bounds.
Two failures that only surface off a dev machine, both hit when preparing
the multimodal tasks for a Beaker run:

The image task bases decode images with PIL, but nothing declared it, so a
job whose extras don't happen to pull Pillow in transitively fails every
image task with `No module named 'PIL'`. Declare `pillow` as a task
dependency on the image-QA, multi-image, pointing and dense-caption bases,
so it installs regardless of which provider runs them.

tqdm builds its class-level write lock lazily, so the parallel task
preparation could read `tqdm._lock` before any thread created it and fail
with an AttributeError. Which task loses the race varies run to run.
Claim the lock once before the pool.
Worker startup was capped at a hardcoded 900s with no way to change it.
A multimodal OLMo-core checkpoint takes ~800s to load from a distributed
checkpoint on shared storage, and concurrent runs against the same weights
push past the ceiling, so every worker times out with "Expected 1 inference
worker(s) to initialize before starting work, got 0".

Read the timeout from OLMO_EVAL_PROVIDER_INIT_TIMEOUT, keeping 900s as the
default and falling back to it when the value does not parse.
Scoring dependencies were declared only in the `hf`/`clients` extras, so a
Beaker job that installs neither imports nothing and every instance fails to
score. The run still reports Success, with the primary metric at 0.0000 —
pixmo_points_eval scored a clean zero on a checkpoint that visibly emits
well-formed points.

Declare them as task dependencies, next to the pillow ones: pycocotools and
scipy for the pointing scorer's RLE decode and bipartite matching, and openai
for the dense-caption, CharXiv and MathVista judges.

Note the underlying reporting gap is untouched: a task whose every instance
fails to score is indistinguishable from one that legitimately scored zero.
The pointing tasks build their own question string, but mm_olmo's `_mp`
variants hand the model a bare label and let its DataFormatter build the
prompt. That prompt follows the checkpoint: pretrain models were trained on
a terse "pointing: <label>", instruction-tuned models on one of 43 templates
sampled from a per-example seed. Neither form was reachable here, so results
could not be compared with any published number.

Add `pixmo_points_eval_mp`, `sa_co_gold_subset_mp` and `sa_co_gold_point_4k_mp`
alongside the existing tasks, sharing their loaders and scoring. The prompt
style is a task config field so it can follow the checkpoint per run.

`sa_co_gold_subset_mp` reads `molmo-subset-v2.json`, the file mm_olmo's
`SACoGoldSubset` uses, rather than the v1 file the non-mp task reads.
`sa_co_gold_point_4k_mp` samples 4096 examples per subset from the full gold
test set (28,672 in total), and reports the abstention accuracies its
evaluator emits, since absent phrases dominate it.

Counts verified against mm_olmo: 1215 / 3856 / 28672. A parity test asserts the
templates and sampled prompts match mm_olmo's, skipped when it is not checked out.
The -o allowlist is hardcoded rather than derived from TaskConfig, so the new
prompt fields were rejected as "not a TaskConfig field". Register them, since
the prompt style has to follow the checkpoint and is therefore set per run.
mm_olmo stores an untied LM head as the transformer's own `ff_out`, but the
key remap only renamed block-level tensors, so it never became `lm_head.weight`.
The loader then took its weight-tied fallback and substituted the embedding
table for the head, which loads and runs without error and generates fluent
garbage: Molmo2-8B-Pretrain scored 0.12 f1 on pixmo pointing against the 4B's
0.82, never emitting EOS.

Rename it, and log when the tied fallback is actually taken so a genuinely
untied checkpoint cannot quietly go down that path again. Weight-tied
checkpoints (the 4B models) have no such tensor and are unaffected.
…ng tasks (#301)

The `_mp` pointing tasks take the checkpoint's prompt family as a task override on the same task
(`-o prompt_templates=none -o system_prompt_style=style_and_length_v2` for a pretrain checkpoint;
`ModelPromptPointingTask`'s defaults target the instruction-tuned models). `dense_caption` instead
expressed the same distinction as a *separate registered task* (`dense_caption_captioner`), so a
run that correctly declared the family for pointing still silently got the released-family caption
prompt. Nothing in the override it already passed had any effect here.

That is easy to get wrong and expensive when you do. A 4B Molmo2 stage-1 checkpoint
(`style_and_length_v2` conditioning, i.e. every caption trained behind a `"<style> <bucket>:"`
prefix) evaluated with the natural-language prompt:

                          dense_caption   with the family declared
    recall                    38.18              45.28
    consistency               69.68              70.69
    recall_at_10              77.20              86.73
    num_statements            19.80              21.66
    avg                       53.93              57.98
    `<points .../>` answers   93 (3.4%)          0
    answers < 30 words        60                 0
    words                med 143, min 3     med 164, min 105

7.1 recall points, and it reads as a model regression rather than a harness setting. Handed a
prompt it never saw in training, the model sometimes answered a caption request with pointing
markup or three words. mm_olmo re-applies the same prefix at inference through
`default_inference_len` (`olmo/data/data_formatter.py`), so the natural-language instruction is
out of distribution for that whole family.

`system_prompt_style` is already on the base task config, so `dense_caption` just honours it:
`style_and_length` / `style_and_length_v2` select `"long_caption {default_inference_len}:"`, and
anything else keeps the seeded natural-language template. One override now describes the
checkpoint for both captions and pointing.

Backwards compatible: the default is unchanged (`demo_or_style_v2` -> seeded template), and
`dense_caption_captioner` still forces the captioner prompt via `caption_prompt`, which takes
precedence over the family.

Verified: prompt resolution checked for no-override, `demo_or_style_v2`, `style_and_length`,
`style_and_length_v2`, and the `dense_caption_captioner` subclass; `make lint` clean (520 files);
`make type-check`'s one diagnostic is pre-existing and in `providers/olmo_core.py:219`, untouched
here.

Co-authored-by: Jason Ren <[email protected]>
…mpt family too (#302)

The previous commit fixed `dense_caption`. The same gap exists on every other benchmark that
builds its own question: mm_olmo's `DataFormatter` keys the `"<style>:"` prefix off the example's
*style*, not off whether the benchmark supplied a ready-made question
(`olmo/data/data_formatter.py`, styles `pointing` / `point_count` / ... under
`style_and_length`/`_v2`). So a `style_and_length_v2` checkpoint was trained on
`"point_count: how many cats?"` and `"pointing: the dog"`, and these tasks were sending the bare
question.

Only the `_mp` variants honoured the family, because they route through `build_pointing_prompt`.
The pre-built-question benchmarks did not, so `-o system_prompt_style=style_and_length_v2` was
silently inert on four of them:

    pixmo_count            point_count   (style confirmed: PixMoCountConfig message style)
    countbench_qa          point_count   (CountBenchQaConfig.format_example sets it explicitly)
    pixmo_points_eval      pointing      (PixMoPointsEval config, pixmo_datasets.py:789)
    sa_co_gold_subset      pointing      (SA-Co gold, academic_datasets.py:1766)

`system_prefix` now takes the style (defaulting to `pointing`, so existing callers are unchanged),
`apply_style_prefix` wraps a pre-built question, and `StylePrefixMixin` gives a task the same
`system_prompt_style` override the `_mp` tasks already had. Each task declares its mm_olmo style.

Backwards compatible: the default stays `demo_or_style_v2`, which adds no prefix, so every existing
run keeps its current prompts. Only an explicit `-o system_prompt_style=style_and_length*` changes
anything.

Verified: prefix resolution checked per task for the default and for `style_and_length_v2`
(`point_count: Q` / `pointing: Q`, bare by default), `dense_caption` from the previous commit still
resolves both ways, `make lint` clean (520 files), and `make type-check` back to its one
pre-existing diagnostic in `providers/olmo_core.py:219`.

Context: on a 4B Molmo2 stage-1 checkpoint the equivalent mismatch on `dense_caption` cost 7.1
recall points and turned 3.4% of caption answers into `<points .../>` markup, so this is worth
several points on the counting and pointing numbers for any pretrain checkpoint.

Co-authored-by: Jason Ren <[email protected]>
jason718 added a commit that referenced this pull request Sep 17, 2026
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]>
jason718 added a commit that referenced this pull request Sep 17, 2026
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]>
jason718 added a commit that referenced this pull request Sep 17, 2026
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]>
jason718 added a commit that referenced this pull request Sep 17, 2026
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]>
jason718 added a commit that referenced this pull request Sep 17, 2026
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]>
jason718 added a commit that referenced this pull request Sep 18, 2026
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]>
jason718 added a commit that referenced this pull request Sep 18, 2026
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]>
jason718 added a commit that referenced this pull request Sep 18, 2026
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]>
jason718 added a commit that referenced this pull request Sep 19, 2026
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]>
jason718 added a commit that referenced this pull request Sep 19, 2026
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]>
jason718 added a commit that referenced this pull request Sep 19, 2026
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]>
jason718 added a commit that referenced this pull request Sep 19, 2026
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]>
jason718 added a commit that referenced this pull request Sep 19, 2026
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]>
jason718 added a commit that referenced this pull request Sep 23, 2026
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]>
jason718 added a commit that referenced this pull request Sep 23, 2026
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]>
jason718 added a commit that referenced this pull request Sep 23, 2026
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]>
jason718 added a commit that referenced this pull request Sep 24, 2026
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]>
@jason718

Copy link
Copy Markdown
Contributor Author

Follow-up issues from the review of this stack, linked here before the last PR merges (as requested on #324):

Stack status: #316, #317, #322 and #323 are merged; #324 is the last.

jason718 added a commit that referenced this pull request Sep 25, 2026
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]>
@jason718

Copy link
Copy Markdown
Contributor Author

One more follow-up from the second review on #324: #415, pinning Hub dataset revisions for the remaining vision tasks. #324 pins the two new ones (BLINK, MMIU).

jason718 added a commit that referenced this pull request Sep 25, 2026
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]>
@jason718

Copy link
Copy Markdown
Contributor Author

Found while validating #324, unrelated to it: #416, the HF huggingface provider's Molmo2 path fails on transformers 5.12 (create_causal_mask keyword rename in the Hub's remote code).

@jason718

Copy link
Copy Markdown
Contributor Author

The five-PR split of this branch is fully merged to main; this PR is superseded.

PR Scope Merged Squash commit
#316 Multimodal inference: image requests, HF VLM path, olmo_core_vlm provider 2026-09-17 35ecf49
#317 evals/vision task framework + dense-caption benchmark 2026-09-19 e1e1688
#322 Pointing (PixMo-Points, SA-Co gold) + counting benchmarks 2026-09-23 73ade80
#323 Image-QA benchmarks (chart/doc/info/text VQA, VQAv2, AI2D, MMMU, MMMU-Pro, MathVista, RealWorldQA, CharXiv) 2026-09-24 f7f652a
#324 Multi-image benchmarks (MuirBench, BLINK, MMIU), multimodal docs, mm_olmo parity 2026-09-28 01c8060

What landed relative to this branch, beyond the restructure into evals/vision/: per-instance metric storage for every vision metric family, strict scorer failure handling with n_scoring_errors, ValueError over assert for data validation, a separate olmo_core_vlm extra pinned to an OLMo-core commit, prompt-family fields in the task hash, the README's Multimodal Evaluation section, and a parity pass that found and fixed six faults along the way (pixmo absent-phrase image size, the dense-caption judge cache key, empty requests.jsonl, over-long prompts failing whole batches, the 16k context window silently dropping MMIU instances, and the Molmo2 HF path on transformers ≥ 5.9).

Parity evidence is in #324's description: re-scoring mm_olmo's Molmo2-4B prediction dumps reproduces its metrics on every benchmark with a dump (exact on PixMo-Points, SA-Co 4k and MuirBench; every residual explained), the stack matches the vision branch byte for byte wherever both runs formed the same batches, and at mm_olmo's settings (-o provider.max_crops=24) it lands within 0.006 of the published Molmo2-4B numbers.

Open follow-ups from the reviews:

@jason718

Copy link
Copy Markdown
Contributor Author

Closing: superseded by the five merged PRs above (#316, #317, #322, #323, #324), all on main as of 01c8060. The vision branch stays until the three PRs still based on it (#347, #355, #401) are rebased onto main.

@jason718 jason718 closed this Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants