Repository navigation
Multimodal eval (1/5): image requests, HF VLM path, OLMo-core VLM provider - #316
Conversation
undfined
left a comment
There was a problem hiding this comment.
Some suggestions before merging, but overall looks great!
281ec08 to
97914ad
Compare
|
@abhishekraok @gregorybchris @AkshitaB Please help me review this. |
abhishekraok
left a comment
There was a problem hiding this comment.
Two issues found in the multimodal inference paths. Validation: 74 targeted CPU tests passed; full GPU generation was not tested.
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.
Looks great overall, and thank you for the thorough responses to the earlier round. I verified every one of Tyler's seven findings and Abhishek's two against the current branch: the find_spec guard, the logprob boundary handling, the split embedding lookup, both allowlists, the package normalization, the extracted mask helper, the olmo_core_vlm extra, and the chat_messages_for_request helper are all present with the tests described. Ruff, ty, and the unit suite (2193 passed) are clean on my machine.
I found two issues that I think should be fixed before merge, both in the "infrastructure failure becomes a score" class, plus a lockfile change worth confirming. The rest are non-blocking.
Blocking
-
src/olmo_eval/common/types/base.py:234
LMRequest.imagesis a shared contract, but only the two multimodal providers read it.vllm,vllm_server,litellm,olmo_core, andmockignore the field, so a vision task run against a text provider produces text-only completions and scores them as a normal run. I reproduced this withMockProvider: a CHAT request carryingimages=("/nonexistent/cat.png",)returns a canned answer with no error. Once the tasks in #317 onward land,-m <text model> -t molmo2_imageqareports Success with meaningless numbers. Please make providers that do not support images raise a clearValueErrorwhenrequest.imagesis set (a check inInferenceProviderkeyed on asupports_imagesattribute would cover all of them), and add a test. Rejecting at planning time would be even better, since the run then fails before any model loads. -
src/olmo_eval/inference/providers/olmo_core_vlm/provider.py:692
A prompt that exceedsmax_lengthis skipped withmetadata["skipped"] = "prompt_too_long"and an empty output. The runner scores that empty output like any other, so a long-prompt instance becomes a zero rather than a recorded failure, and the hard-failure gate never sees it. The textOlmoCoreProviderhas no equivalent silent path. Could this raise instead, so the runner records the instance inscoring_errorsand the failure rate reflects it? If skipping is the intended contract, the runner needs to countskippedoutputs as failures, and that belongs in the same change.
Non-blocking
-
uv.lock
The lock now carries twotorchaoentries, 0.15.0 and 0.17.0, wheremainhas only 0.17.0. The 0.15.0 entry appears to have come in with the git-pinned OLMo-core resolution. Please confirm which extras resolve to which version, in particular that the textolmo_coreextra still gets 0.17.0, and note it in the description. If the text path moved to 0.15.0, that is a core numeric dependency change and deserves the small parity canary we ask for on dependency bumps. -
src/olmo_eval/inference/__init__.py:135
kind=olmo_corenow sniffs the checkpoint and silently constructsOlmoCoreVLMProvider. On Beaker,BACKEND_OPTIONAL_GROUPS["olmo_core"]installs the 2.4.0 extra, which has noolmo_core.nn.vision, and the two extras are declared conflicting, so this route can only fail at worker init there. Locally it works only when the user happened to install the VLM extra. It also makes the provider class depend on on-disk content rather than declared config. I would drop the sniffing and raise a clear error that nameskind=olmo_core_vlm, or at minimum log at WARNING when the reroute happens. -
src/olmo_eval/inference/providers/config.py:242
ProviderConfig.from_dictnow forwards every unknown key intokwargsfor every provider kind, not just the multimodal ones. Previously a typo in a YAML provider block was dropped; now it reaches the constructor and either raises there (vLLM) or is absorbed by**kwargs(HF passes it tofrom_pretrained). That is arguably better, but it is a behavior change for all providers with no test. Please add afrom_dicttest and mention the change in the description. -
src/olmo_eval/runners/asynq/monitoring.py:20
OLMO_EVAL_PROVIDER_INIT_TIMEOUTis parsed at import time with a barefloat(), so a bad value fails on import of the monitoring module far from the cause, and the variable is not documented anywhere in the stack, including the README section in #324. Could it be read insidewait_for_provider_initwith a clear error, and documented? -
src/olmo_eval/inference/providers/olmo_core_vlm/provider.py:818
The logprob entries here carry onlytokenandlogprob.HuggingFaceProviderand the textOlmoCoreProvideralso emittoken_idandbytes, andngram_copyingreadsbytes. Could this match the other providers? -
src/olmo_eval/inference/providers/huggingface.py:539andolmo_core_vlm/provider.py:652
Both multimodal paths.strip()the generated text; the HF text path does not. If the strip mirrors mm_olmo, a one-line comment saying so would help. If not, it changes what the scorers see. -
src/olmo_eval/inference/providers/huggingface.py:96
_patch_processor_optional_attribute_kwargsreplacesProcessorMixin.__init__process-wide, so it affects any other processor loaded in the same process. It is idempotent and guarded, which is good. Worth a sentence in the docstring about the blast radius. -
Branch base
The stack is based on254e2c22, four commits behindmain, and the "Rebase on main; regenerate the lock" commit did not actually move the base. This PR merges cleanly, but the lock was regenerated against the old base, so please rebase before merging.
Nits
- Nit:
checkpoint.py:42has a dangling comment ("Default tokenizer for Molmo2-family models...") with no constant under it. - Nit:
checkpoint.py:261and:425tell users to pinprovider.package=...OLMo-core.git@vision; that is superseded by theolmo_core_vlmextra this PR adds. - Nit:
preprocessing.py:17has an emptyif TYPE_CHECKING: pass. - Nit:
infrastructure.py:129addsai2/holmestoWEKA_CLUSTERS, which is unrelated to this PR. - Nit: the description still lists
TaskConfig.prompt_templates / system_prompt_styleunder core plumbing; those moved to #317.
Before merge
Items 1 and 2, a confirmation on item 3, and a rebase onto current main. After that, feel free to merge once CI is green. Items 4 through 10 can be follow-ups if you prefer; if so, please file an issue for item 4 so the olmo_core auto-route does not get forgotten.
|
All seven items addressed in f411948 (blocking) / description (notes): 1 (blocking) — providers now declare 2 (blocking) — the 3 — good catch, and it was actually worse than two entries: uv had unified both conflict forks on the git pin's 4 — the reroute now logs a WARNING naming the explicit kind, and the README steers to 5 — behavior kept (a typo surfacing in the provider beats silent dropping), now tested ( 6 — 7 — VLM logprob entries now carry Full suite at the stack tip: 2,419 passed; lint/format/ |
f411948 to
4ff30fc
Compare
e81a706 to
0b8dc7a
Compare
…provider First of five PRs splitting the vision branch (#278) into milestones. This one makes any VLM checkpoint promptable with images; the benchmarks follow. Requests carry images (`LMRequest.images`) and the harness passes them through. The prompt family (`prompt_templates` / `system_prompt_style`) is a task config field settable per run, because mm_olmo derives the prompt from settings recorded in each checkpoint's own config. The HuggingFace provider gains an image-text-to-text path with transformers-5 shims for the Molmo2 remote code and fp32/bf16-autocast numerics matching mm_olmo, and loads consolidated OLMo-core exports by converting weights in-memory to the released layout. The new OLMo-core VLM provider runs raw MultimodalLM checkpoints in three on-disk formats, decoded with a batched variable-length KV cache. It lands as a package split by responsibility (checkpoint / conversion / preprocessing / cache / provider), content-identical to the reviewed #278 code by AST comparison. Also the operational fixes that running this at scale required: an env override for the 900s provider-init ceiling, an eager tqdm lock before parallel task preparation, and the missing extras mapping for the new provider kind. Co-authored-by: Ziqi Gao (Roy) <[email protected]>
Add `molmo2-8b` and `molmo2-o-7b` presets mirroring the validated 4B eval settings (fp32 weights + bf16 autocast, max_crops=24 — mm_olmo evaluates the whole family with the same protocol). Collapse the provider-init timeout override to a single expression; the env var is the point, the wrapper wasn't.
Per review on the split PR: - The mm_olmo unpickle shim consults sys.modules before find_spec, which raises ValueError once the shim (registered with __spec__ = None) is installed — repeat provider construction in one process crashed before. - logprobs mirrors OlmoCoreProvider's boundary handling: the limit resolves from request.max_length, an empty continuation returns an empty zero-logprob result, an over-limit continuation raises instead of failing inside gather, and the context truncates only after those checks. - The split-vocab embedding does a two-table lookup instead of caching a concatenated copy of the whole embedding matrix (~2.5 GB at the 8B size). - Package overrides for provider.kind=olmo_core_vlm normalize like olmo_core (version shorthand, git-URL binding, bundled-extra replacement), and the kind joins the sequential-only batching allowlist so a streaming config fails validation rather than serializing behind the provider lock. - The cached-decode SDPA mask construction is a module-level helper with direct tests for causal prefill, or_mask reopening and alignment, and left-padding semantics. - The unused TaskConfig prompt-family fields move out of this PR; they land with their first consumer. Tests: shim called twice, mask cases above, split-vocab lookup vs a concatenated table, and logprob boundaries (empty / at-limit / over-limit / per-request / non-positive).
The max_model_len/max_length alias resolver was a verbatim copy of the one in olmo_core_utils; reuse it, with the provider name parameterized for its error messages. Inline the single-caller _select_token delegate.
~3 of 4 Beaker loads of the untied 8B checkpoint returned the embedding table as the LM head — every other tensor correct, output noise, score at chance, nothing raised. The guard rejects a load whose untied head is bit-identical to the embeddings. Also picks up ai2/holmes in WEKA_CLUSTERS (#330).
…tem messages No ai2-olmo-core release supports this provider yet: 2.6.0 ships the vision classes but rejects vision-branch training configs (`flex` backend, `masked_dropout`) and lacks molmo2_loader; 2.4.0 has none of it. The provider gets its own `olmo_core_vlm` extra pinned to a vision-branch commit, so the declared installation works while the text provider's `olmo_core` pin stays untouched (the extras conflict, and beaker jobs map the provider kind to the new extra). Attention-backend values are rewritten in the raw config before enum coercion, and the molmo2_loader imports fail with an actionable message under an incompatible install. Verified by a GPU smoke through the declared extra: checkpoint load, image pointing, and text-only generation. Completion requests keep their prompt when the harness injects a system message: both providers now build chat turns via chat_messages_for_request, which appends the prompt as a user turn whenever no user turn exists, instead of letting a non-empty messages tuple displace the question.
…fork - Providers declare `supports_images` and the harness rejects image requests aimed at a provider that cannot render them, so a vision task on a text provider fails loudly instead of scoring text-only completions. The mock provider opts in deliberately to keep vision suites dry-runnable. - A multimodal prompt that exceeds max_length now raises (mirroring the text provider's budget error) instead of scoring an empty "skipped" output that the failure gate never saw. - The text `olmo_core` extra pins torchao==0.17.0: the conflicting git-pinned VLM extra requires 0.15.0, and without the pin uv unified both resolution forks on 0.15.0 — a silent downgrade of the text provider's numeric stack from main. `uv export` per extra confirms 0.17.0 / 0.15.0. - The kind=olmo_core multimodal reroute logs a WARNING naming provider.kind=olmo_core_vlm (remote jobs must install the matching extra). - OLMO_EVAL_PROVIDER_INIT_TIMEOUT is read at use time with an error that names the variable, instead of a bare float() at import. - VLM logprob entries carry token_id and bytes like the other providers (ngram_copying reads bytes). - ProviderConfig.from_dict kwargs passthrough gets the missing test.
The vllm dependency group was declared as `olmo-eval[vllm]`, and the vllm extra participates in the declared conflicts — uv 0.10 gates a conflicting extra's edges behind opt-in markers, so once the olmo_core_vlm conflict pairs reshaped the fork structure, the default group resolved to nothing and `uv sync --frozen` silently installed no vllm at all. The group now lists the vllm requirements directly, so default installs (local dev, beaker text jobs) keep vllm regardless of conflict structure. Also re-locks from main's lockfile as the base, which removes the incidental floating-version drift earlier from-scratch locks introduced (numpy, pandas, starlette are back at main's versions; the default+olmo_core profile is now byte-identical to main's resolution).
Direct DCP loads under storage contention were the only consumer, and the right fix for those is consolidating the checkpoint before eval (tracked in a follow-up issue) rather than a per-launch timeout knob. monitoring.py is back to main's version.
Its only production consumer is vLLM serving, which lands separately; here it was a third route between the two providers plus a filesystem sniff on every text-provider init. The VLM provider still loads consolidated exports natively.
82221c5 to
4b6870e
Compare
Description
First of five PRs splitting #278 into reviewable milestones.
Milestone: any VLM checkpoint — released HF or raw OLMo-core — can be prompted with images.
No tasks or benchmarks yet; those follow in #317 (framework + captioning) → #322 (pointing + counting) → #323 (image QA) → #324 (multi-image + docs).
Core plumbing
LMRequest.imagesand harness pass-through — tasks attach lazy image references (paths / picklable callables), providers resolve them at inference timesupports_images; the harness rejects image requests aimed at a provider that cannot render them, so a vision task on a text provider fails loudly instead of scoring text-only completions (mock opts in so vision suites stay dry-runnable)ProviderConfig.from_dict— unknown keys now reach the constructor for every provider kind, so a typo'd YAML key surfaces instead of being dropped silently (tested)chat_messages_for_request, which appendsrequest.promptas a user turn whenever no user turn existsHF multimodal provider
huggingface.pygains an image-text-to-text path:AutoProcessor+AutoModelForImageTextToText, transformers-5 shims for the Molmo2 remote code, and fp32-weights/bf16-autocast matching mm_olmo'samp_bf16numerics. Presets:molmo2-4b,molmo2-8b,molmo2-o-7b(all mirror mm_olmo's official eval settings). The text path is untouched:_init_textis the old constructor verbatim, and every shim runs only inside the multimodal init.OLMo-core VLM provider — as a package
inference/providers/olmo_core_vlm/, split by responsibility:checkpoint.pypreprocessing.pycache.pyor_mask, left padding, decode)provider.pyOlmoCoreVLMProvider— batched variable-length KV-cached decode loopThe split is AST-verified content-identical to the reviewed #278 code. A prompt exceeding
max_lengthraises (multimodal prompts cannot be truncated without corrupting the image-token layout) rather than scoring an empty output.logprobsmirrorsOlmoCoreProvider's boundary handling (per-request limits, empty/over-limit continuations) and emitstoken_id/bytesentries like the other providers.Dependency isolation (the part to scrutinize)
The multimodal classes are in no ai2-olmo-core release (2.6.0 ships
nn.visionbut rejects vision-branch configs and lacksmolmo2_loader), so the provider has its own opt-in extra, and the text side is untouched:olmo_coreextra: unchanged —ai2-olmo-core==2.4.0, withtorchao==0.17.0pinned explicitly so the conflicting fork below cannot drag it downolmo_core_vlmextra:ai2-olmo-core @ git+…OLMo-core.git@2dad929a(vision branch, pinned by SHA), declared conflicting witholmo_core/openhands— the two OLMo-cores can never coexist in one install. Beaker mapsprovider.kind=olmo_core_vlmto this extrahfextra: +einops,torchvision(required at import by the Molmo2 remote code); +pycocotools/scipyarrive with the pointing family in Pointing + counting benchmarks (3/5) #322uv syncsilently installed no vllmuv export:default+olmo_core(the Beaker text-eval profile) is byte-identical to main's resolution; the CI profile differs only by pure additions; numpy/pandas/starlette are at main's exact versionskind=olmo_corestill auto-detects multimodal checkpoints (returns to the text path on any read error) but logs a WARNING steering to the explicit kind, since remote jobs must install the matching extraRunner fixes (from running this at scale)
tqdm.get_lock()before parallel task preparation (lazily-created class lock races)--secret-envmappings satisfyrequired_secretsvalidation (previously only the user-scoped secret was accepted)olmo_core_vlmin_SEQUENTIAL_ONLY, package-override normalization for both OLMo-core kinds, mm_olmo unpickle shim is idempotentTesting
Everything below runs on CPU with no API keys:
Targeted suites: harness image pass-through +
supports_imagesrejection (tests/core/harness/test_harness.py), HF multimodal shims (tests/providers/test_huggingface_multimodal.py), provider unit tests incl. key-remap regression, unpickle-shim idempotence, decode-mask cases, split-vocab embedding equivalence, logprob boundaries, untied-head guard, andchat_messages_for_request(tests/providers/test_olmo_core_provider.py).GPU verification: checkpoint load + image pointing + text generation through the declared
olmo_core_vlmextra (no overrides); out-of-band vs mm_olmo on real checkpoints — prompt construction token-exact (765/765 input_ids), KV-cached decode token-identical to uncached. End-to-end: the full stack ran caption/pointing/counting on a fresh stage-1 checkpoint on Beaker (5 tasks, 8,831 instances, zero failures).Review history
Three rounds, all findings addressed with fixes + tests: 7 from @undfined (shim idempotence, logprob boundaries, package normalization, embedding memory, batching allowlist, mask-helper extraction, field placement), 2 from @abhishekraok (installable extra, completion-prompt preservation), 7 from @gregorybchris's review agent (image-request contract, silent skip, lock fork, reroute warning, kwargs test, timeout parsing, logprob fields).
Type of Change
Checklist
Part of #278 (tracking). Next: #317 — vision task framework + captioning.