Skip to content

Multimodal OLMo-core checkpoint eval: olmo_core_vlm provider, HF-provider export support, dense-caption conformance fixes - #245

Merged
uwGZQ merged 1 commit into
visionfrom
royg/olmo-core-multimodal-eval
Jul 9, 2026
Merged

uwGZQ merged 1 commit into
visionfrom
royg/olmo-core-multimodal-eval

Conversation

@uwGZQ

@uwGZQ uwGZQ commented Jul 9, 2026

Copy link
Copy Markdown

Adds first-class eval support for multimodal OLMo-core checkpoints (the MultimodalLM vision branch models), so they can be evaluated directly from their training formats — no offline conversion to the released allenai/Molmo2-4B HF format required. Also carries three conformance fixes for the PixMo-Cap dense-caption eval found in a line-by-line review against mm_olmo.

1. New olmo_core_vlm provider

ProviderKind.OLMO_CORE_VLM (auto-routed from olmo_core when the checkpoint is multimodal). Loads three on-disk formats:

Format Layout Loading
olmo_core_dcp config.json (MultimodalLMConfig under model) + model_and_optim/ DCP MultimodalLMConfig.from_dict (legacy MultimodalTransformerConfig class name rewritten) + load_model_and_optim_state
olmo_core_unsharded olmo_core_config.json + model.safetensors with lm.*/vision.*/connector.* keys direct safetensors load
mm_olmo_dcp config.yaml (video_olmo) + DCP with legacy fused keys config translated + keys remapped via OLMo-core's molmo2_loader (fused QKV/SwiGLU splits, tied-lm_head synthesis, patch-embed permute)

Design points:

  • Prompt construction is token-exact with the released Molmo2 processor (chat-template image hoisting, BOS rule, expanded image-token splicing) — verified 765/765 input_ids and identical pooled-patch indices on a real image.
  • KV-cached decoding: the mask-capable torch/flex attention backends reject KV caching, so the provider installs a cache-capable dense-SDPA backend subclass on the LM blocks (OLMo-core's Attention/KVCacheManager plumbing reused as-is). Token-for-token parity with no-cache decoding verified; ~10× decode speedup for caption-length outputs. use_cache=False falls back to full re-forward.
  • The LM head is untied before loading (checkpoints store differing embeddings/w_out tensors despite tie_word_embeddings, and OLMo-core's tie shares storage — loading both into one parameter would silently clobber).
  • Bidirectional image-token attention (or_mask) on by default, matching HF Molmo2 / mm_olmo bi_directional_attn: image_tokens.
  • Over-length prompts clamp max_tokens (or skip with a warning) instead of raising; decode is serialized with a lock for the async harness; multi-image requests supported (crop-axis concat with offset pooled indices).
  • Text-only loglikelihood implemented; image loglikelihood raises (all image tasks are CHAT), mirroring the HF multimodal provider.

2. HuggingFaceProvider: consolidated OLMo-core exports

The HF provider (the verified released-Molmo2 path) now also accepts olmo_core_unsharded export dirs: auto-detected, weights converted in-memory back to released-Molmo2 naming (convert_olmo_core_to_molmo2_hf_state_dict, the exact inverse of OLMo-core's HF loader mapping), config/processor/modeling code borrowed from a reference repo (reference_model kwarg, defaulting to the export's recorded model_id). Everything downstream is the stock remote-code path (model.generate, transformers-5 shims).

Verification: converting a real export reproduced its independently-converted released-format twin bit-exactly (706/706 tensors), and end-to-end greedy generation matched the released-format checkpoint word-for-word. Cross-provider check: hf and olmo_core_vlm on the same export scored identically (0.8125) on a 32-example real_world_qa slice.

3. Dense-caption (PixMo-Cap) conformance fixes

From a line-by-line review against mm_olmo main (b8bb0e79) plus a real mm_olmo DenseCaptionEval-test prediction dump:

  1. Prompt seed: dense_caption_question now uses DENSE_CAPTION_LOADER_SEED = 6198 — the launch_scripts/eval.py dense-caption pipeline's loader seed, verified via the dump's _getter_seed == (6198·195172 + idx) mod 2³²−1 — instead of the image-QA loader seed 691203 (which remains correct for pixmo_count). Per-example template picks now match mm_olmo's caption pipeline.
  2. num_statements now reports mm_olmo's quantity: the mean count of canonical statements GPT derives from the model caption (consistency side, over consistency-valid examples), not the recall-side mturk statement count. Recall/consistency/avg were already exact and are unchanged.
  3. New task dense_caption_captioner: for mm_olmo captioner-family checkpoints (prompt_templates="none" + system_prompt="style_and_length_v2"), whose eval prompt is the constant "long_caption 65:" with an empty user question (verified verbatim in the dump). The default dense_caption task keeps the released-Molmo2 (uber_model_v2) behavior.

Note: fix 1 changes generated captions for uber_model_v2-style models, so the next dense_caption run re-generates and re-judges (fresh GPT-judge cache entries) rather than reusing caches keyed to the old prompts.

Tests

  • Full non-integration suite: 1795 passed, 5 skipped; ruff check/format clean.
  • Test updates limited to the changed semantics: the num_statements synthetic-result helper and five pinned dense-caption prompt expectations (recomputed under seed 6198).

…der)

- 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.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017MspMapxs8uKP6nhCizNiV
@uwGZQ
uwGZQ marked this pull request as ready for review July 9, 2026 09:19
@uwGZQ
uwGZQ merged commit 7a2d00d into vision Jul 9, 2026
1 check passed
@gregorybchris
gregorybchris deleted the royg/olmo-core-multimodal-eval branch October 7, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant