Repository navigation
Multimodal OLMo-core checkpoint eval: olmo_core_vlm provider, HF-provider export support, dense-caption conformance fixes - #245
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds first-class eval support for multimodal OLMo-core checkpoints (the
MultimodalLMvision branch models), so they can be evaluated directly from their training formats — no offline conversion to the releasedallenai/Molmo2-4BHF 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_vlmproviderProviderKind.OLMO_CORE_VLM(auto-routed fromolmo_corewhen the checkpoint is multimodal). Loads three on-disk formats:olmo_core_dcpconfig.json(MultimodalLMConfigundermodel) +model_and_optim/DCPMultimodalLMConfig.from_dict(legacyMultimodalTransformerConfigclass name rewritten) +load_model_and_optim_stateolmo_core_unshardedolmo_core_config.json+model.safetensorswithlm.*/vision.*/connector.*keysmm_olmo_dcpconfig.yaml(video_olmo) + DCP with legacy fused keysmolmo2_loader(fused QKV/SwiGLU splits, tied-lm_head synthesis, patch-embed permute)Design points:
input_idsand identical pooled-patch indices on a real image.torch/flexattention backends reject KV caching, so the provider installs a cache-capable dense-SDPA backend subclass on the LM blocks (OLMo-core'sAttention/KVCacheManagerplumbing reused as-is). Token-for-token parity with no-cache decoding verified; ~10× decode speedup for caption-length outputs.use_cache=Falsefalls back to full re-forward.embeddings/w_outtensors despitetie_word_embeddings, and OLMo-core's tie shares storage — loading both into one parameter would silently clobber).or_mask) on by default, matching HF Molmo2 / mm_olmobi_directional_attn: image_tokens.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).2.
HuggingFaceProvider: consolidated OLMo-core exportsThe HF provider (the verified released-Molmo2 path) now also accepts
olmo_core_unshardedexport 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_modelkwarg, defaulting to the export's recordedmodel_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:
hfandolmo_core_vlmon the same export scored identically (0.8125) on a 32-examplereal_world_qaslice.3. Dense-caption (PixMo-Cap) conformance fixes
From a line-by-line review against mm_olmo main (
b8bb0e79) plus a real mm_olmoDenseCaptionEval-testprediction dump:dense_caption_questionnow usesDENSE_CAPTION_LOADER_SEED = 6198— thelaunch_scripts/eval.pydense-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 forpixmo_count). Per-example template picks now match mm_olmo's caption pipeline.num_statementsnow 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.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 defaultdense_captiontask keeps the released-Molmo2 (uber_model_v2) behavior.Note: fix 1 changes generated captions for
uber_model_v2-style models, so the nextdense_captionrun re-generates and re-judges (fresh GPT-judge cache entries) rather than reusing caches keyed to the old prompts.Tests
ruff check/formatclean.num_statementssynthetic-result helper and five pinned dense-caption prompt expectations (recomputed under seed 6198).