Skip to content

Integrate native three-stage vision alignment - #869

Closed
RustinS wants to merge 18 commits into
rustins/native-olmo-ddp-runtimefrom
rustins/native-vision-alignment
Closed

RustinS wants to merge 18 commits into
rustins/native-olmo-ddp-runtimefrom
rustins/native-vision-alignment

Conversation

@RustinS

@RustinS RustinS commented Sep 16, 2026 •

Copy link
Copy Markdown

Integrate native three-stage vision alignment

Summary

Add a maintained vision-alignment workflow on top of the native OLMoDDP infrastructure PR. The training entry point uses the existing internal experiment CLI and dataclass configuration system.

  • Run bridge, perception, and joint training sequentially in one two-node allocation, with a fresh distributed process and optimizer for each phase. Explicit single-phase launches remain available.
  • Build the LM architecture, tokenizer, and joint text replay from the pretrained checkpoint. Initialize the vision stack from its configured pretrained model.
  • Use prepared visual sources, calibrated source weights, isolated packed-example attention, and resumable grouped text/vision loading. Source adapters remain configurable through ordinary dataset configs.
  • Preserve model-only phase handoffs and full-state active-phase resume. A phase completes only after successful training and final-step held-out validation.
  • Provide maintained fast-text, decoded-vision, and academic checkpoint-evaluation entry points with independently reusable completed work.
  • Document configuration, source calibration, checkpoint handoffs, and evaluation separately from historical experiments.

Default workflow

Phase Steps Microbatch sequences/GPU Trainable components
Bridge 500 4 Connector and reserved image-token input rows
Perception 2,000 4 Bridge components and vision encoder
Joint 1,500 2 Perception components and LM body; output projection frozen

All phases use 8K sequences and a 64-crop packed-sequence limit. The per-image crop limit is separate. Bridge retains its 250-step cosine schedule followed by the learning-rate floor; perception and joint schedules match their training horizons. Frozen-LM phases disable router load-balancing loss; joint restores the pretrained per-layer coefficients. No router-input RMS repair is applied.

Joint text replay preserves the checkpoint's tokenizer, file ordering, filtering, masks, and storage dtype. Its held-out replay windows are excluded from joint training, not from the original LM pretraining.

Evaluation compatibility

Saved evaluation panels remain inputs, not regenerated datasets. Decoded-panel deserialization adapts the former panel-class path without importing historical launch/config modules or changing row selections. Academic evaluation preserves saved recipients, donors, prompts, crop limits, generation limits, scoring, and overlap annotations. Those annotations describe the manifest's original training inventory, not every checkpoint evaluated later.

New result formats separate benchmark definitions from execution identity and do not adopt historical receipts as current completion records. Frozen historical deployments remain available outside this PR until distributed parity passes. The academic panel is a fixed validation subset, not the complete official benchmark splits.

Scope and prerequisites

Depends on #868, currently at 759e49820. The prepared diff contains only vision model/data/training integration, the alignment recipe/controller, maintained evaluation components, focused tests, and documentation: 100 files, +22,580/-761 lines. Code/docs/config are 54 files (+11,731/-723); tests are 46 files (+10,849/-38).

Excluded: mixed-midtraining recipes and ablations, historical promotion/source-replay frameworks, experiment launch catalogs, frozen runtime archives, and personal result artifacts. Existing checkpoints with experiment-specific callback/config classes still require their matching frozen deployment; this PR does not rewrite those checkpoints.

Validation and remaining merge gates

The isolated candidate currently passes 97 focused evaluation CPU tests without skips,
including checkpoint metadata/loading contracts, bounded image pairing, decoded-panel
compatibility, full academic saved-result rescoring, and prompt-token checks. Its complete
Sphinx dummy build succeeds with zero documentation warnings (58 pages; intersphinx network
lookups disabled), and all evaluation modules/tests pass Ruff, Black, and isort checks.

  • Validate the isolated candidate against the infrastructure branch, including imports, wheel contents, and documentation links.
  • Run focused vision model, dataset, packing, loss, replay, callback, controller, and checkpoint tests in that candidate.
  • Confirm fresh-process all-stage handoffs, phase completion, and full-state restart in a distributed canary using the final candidate source.
  • Complete legacy/native EP8 decoded and academic parity for the historical perception and current joint checkpoints.
  • Run changed-file style checks and inspect the final diff for historical dependencies or experiment files.

After the infra compatibility correction, the cross-layer suite passed 454 tests with five GPU-only checks skipped. The data suite separately passed 441 tests, and NumPy/replay allocation checks passed 21. Removing six unused annotation-hash methods passed 157 focused tests (overlapping the data suite). Real fresh-process Gloo controller checks passed; the final GPU training/resume canary remains outstanding. The wheel matches all 307 Python sources, imports directly without installation, and contains no generated binaries or legacy/mixed recipe artifacts. The source-only patch applies cleanly to an independent checkout of the exact stack base. These invocations overlap and are not summed into a unique total.

Candidate academic tests rescore 3,072 examples / 9,216 image-control scores and check saved
prompt token counts and generated-token decoding. Exact decoded rescoring of 896 saved rows
was additionally checked in the development worktree. Distributed evaluation parity is still
pending; no quality or speed improvement is claimed by this refactor.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 018d55fe14

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/olmo_core/eval/vision_academic.py Outdated
Comment on lines +950 to +951
with torch.inference_mode():
logits = self.train_module.model_forward_no_pipeline(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use grad-enabled eager execution for academic LM forwards

On the documented torch 2.11/B300 target, this inference-mode forward bypasses the safeguard in MultimodalOLMoDDPTrainModule._eval_batch_context, which explicitly enables gradients and forces eager execution because the no-grad specialization can produce incorrect attention outputs. The same issue affects the free-answer loop below, so both multiple-choice and generated academic scores can be silently wrong; keep vision encoding detached if desired, but run each LM forward through the module's grad-enabled eager evaluation context.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 0929586 (included in current head 90400c7). Image encoding and both LM prediction paths now use the existing eager, grad-enabled evaluation context, with enclosing inference mode disabled. Projected image features and logits are detached promptly. Tests cover MC/free-answer paths under normal, no-grad, and inference-mode callers, graph release, feature reuse, and mode restoration. An execution.forward_context field uses existing receipt equality checks to reject pre-fix cached fragments without changing benchmark definitions. The integrated 95-test suite passes, including saved-reference rescoring and prompt-token checks. These checks do not establish GPU prediction parity; that remains a separate pre-merge validation.

Comment on lines +951 to +957
logits = self.train_module.model_forward_no_pipeline(
input_ids,
encoded_image_features=encoded_features,
token_type_ids=token_type_ids,
position_ids=position_ids,
logits_to_keep=logits_position,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Mask padded academic tokens out of MoE routing

Whenever a prompt length is not a multiple of the 128-token bucket, _inputs pads the sequence, but this direct model call omits router_token_mask. Those trailing padding tokens are therefore dispatched through the routed experts and consume expert capacity, which can drop or alter real prompt-token expert outputs under capacity pressure and make benchmark predictions depend on bucket padding. Pass a mask that is true only for the prompt/generated prefix on both this call and the free-answer loop, as the decoded evaluator already does.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The missing mask is observable, but the stated capacity-drop mechanism does not apply to this evaluator's supported path: _evaluate explicitly selects sync_1d and eval mode; OLMoDDPBlock uses the synchronized dropless path, which dispatches all N * top_k routes using exact counts. That dispatch also does not consume router_token_mask, so adding the argument alone would not change routing or padding overhead. Routing is left unchanged here. Mask/capacity handling would need revisiting if a capacity-limited evaluation backend is introduced.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ef91c056f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/olmo_core/data/numpy_dataset.py Outdated
npdtype=self.get_dtype(), sequence_length=self.sequence_length
)
# Keep path and allocation indices aligned after dropping empty sources.
mixture.filter_zero_token_paths = True

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve zero-allocation paths when replaying older checkpoints

When the pretraining checkpoint was produced before this change and its source mixture assigned zero tokens to any path, data_paths.txt still contains that path, but this filtering removes it from the rebuilt dataset. PretrainingReplayConfig.build() then compares dataset.paths with the saved list and raises Rebuilt source mixture differs, preventing joint alignment even though the logical replay windows are unchanged. Normalize historical saved path lists against the allocation or retain those zero-allocation entries for replay compatibility.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 0929586 (included in current head 90400c7). NumpyFSLDatasetConfig retains zero-allocation occurrences and their per-path metadata. Replay accepts the exact full saved path list or its exact positive-allocation projection, preserving order and duplicate occurrences; changed positive order/count/content is still rejected. Tiny real-data regressions cover both checkpoint representations, masks, metadata, zero-only index skipping, and shared-index sizing. Replay and mixture tests pass. The current s002-step125500 checkpoint uses the unweighted mix branch and was not affected.

Comment on lines +31 to +32
path = Path(self.trainer.save_folder) / callback.step_metrics_fname.format(step=self.step)
if path.is_file():

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Read restored metrics through the filesystem abstraction

When trainer.save_folder is an object-store URL such as s3://... or gs://..., converting it to Path produces a local-looking path, so is_file() always fails and the existing same-step metrics are never restored. The resumed startup/final evaluation can then overwrite metrics_stepN.json with only the new evaluation fragment, losing the previously saved training metrics. Use the repository's URL-aware existence/resource helpers rather than pathlib here.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 0929586 (included in current head 90400c7). Restoration now checks file_exists on the intact URL and reads through resource_path instead of converting object-store URLs to pathlib paths. Tests verify local/S3/GCS restoration preserves training metrics when same-step evaluation updates the snapshot, plus rank-zero/checkpoint-loaded/missing-file guards. The metric-saver suite passes all 17 tests.

Use eager grad-enabled academic forwards with detached features and logits, distinguish their cached results, preserve zero-allocation replay paths, and restore resumed metrics through URL-aware IO. Add focused regression coverage without changing benchmark definitions.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d265f90255

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +257 to +260
arrow_fingerprint = (
cfg.expected_materialized_fingerprint
if cfg.expected_materialized_fingerprint is not None
else getattr(self._data, "_fingerprint", None)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Verify the pinned FineVision fingerprint against loaded data

When expected_materialized_fingerprint is configured—as it is for the default audited-alignment sources—this branch substitutes the expected value without ever reading or comparing the loaded Arrow dataset's _fingerprint. A stale or replaced materialization can therefore be trained on while retaining the reviewed fingerprint and, when its filtered row indices happen to match, the same packed-loader resume identity. Read the observed fingerprint and reject a mismatch before incorporating the pinned value into the content fingerprint.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in abc3f46, integrated at c6c884e. The underlying trust gap was real, but the configured pins are materialization-content SHA-256 values, not HF dataset fingerprints; HF fingerprints also change on column projection. The loader now recomputes the custom pin from its materialization manifest, checks the exact ordered Arrow files actually loaded and row totals, and verifies Arrow/dataset-info bytes against the pinned digests. Successful byte checks reuse the existing filesystem-cache mechanism under a dedicated data-verification environment variable; keys include canonical path, device/inode, size, nanosecond mtime/ctime, and expected digest. Changed files are rehashed, failures are not cached, and pre-load/post-verification identities detect replacements while mmap loading or verifying. A supplied pin is checked even without strict_annotations. Valid old resume identities remain unchanged. Tests cover projection, incorrect pins/inventories, same-size edits with restored mtime, cache hits/failures, and mutation races. The real Geo170K materialization passed verification and a no-rehash repeat; no full corpus replay was performed. The integrated 386-test PR suite passes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c6c884edd2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

raise ValueError(f"Truncation to {max_len} removed all loss tokens")
n = len(seq["input_ids"])
return {k: (v[:max_len] if v.ndim == 1 and len(v) == n else v) for k, v in seq.items()}
out = {k: (v[:max_len] if v.ndim == 1 and len(v) == n else v) for k, v in seq.items()}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve metadata when truncating examples

When the new MaxSequenceLengthDataset wraps an academic or multi-image source and an example exceeds the limit, the example commonly contains a non-array metadata dictionary. This comprehension accesses v.ndim for every field, so truncation raises AttributeError instead of retaining non-token fields as documented; with the mixture loader's skip policy, this can skip valid long rows and eventually exhaust the data-error tolerance. Only inspect/slice NumPy arrays or explicitly slice the per-token fields.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in bb051c9, integrated at efb6086. Truncation now inspects ndim and slices only NumPy arrays; metadata dictionaries and other non-token values are preserved. The helper and MaxSequenceLengthDataset return annotations now allow those fields. Four parameterized cases cover direct/wrapped calls and truncation/no-op paths, checking token slices, metadata/scalars/lists/images/pooled indices, and unchanged input examples. Existing image-structural-token, all-loss-token, and branch-weight safeguards remain covered. All 61 formatter/dataset tests and the integrated 319-test PR suite pass; the corresponding original vision-moe verification passes 361 tests.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 15676a64c1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/olmo_core/eval/multimodal_panel.py Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f06e915c60

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 16a9abcf2b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +579 to +580
group_sequence_quotas={"text": 16, "vision": 112}
if recipe.phase == AlignmentPhase.joint

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject unsupported all-stage world sizes before training

When an all-stage launch uses the documented --launch.* overrides to increase beyond 16 workers (for example, four 8-GPU nodes), these fixed joint quotas are not divisible by the DP world size, so MixtureDataLoader rejects them at construction. Because _run_pipeline does not build the joint configuration until bridge and perception have completed, this can waste both earlier training phases before the incompatibility is discovered. Validate the launch world size up front or derive compatible global batch and group quotas for the joint phase.

Useful? React with 👍 / 👎.

jason718 added a commit that referenced this pull request Oct 1, 2026
…ster sync

A multimodal model trains a vision encoder, a connector and a language model
whose gradients live on different scales, and it loads pretrained weights into
the model after the optimizer has materialized its FP32 masters. Add a subclass
of OLMoDDPOptimizer (plus a config subclass) that the alignment recipe builds:

- opt-in gradient clipping per logical scheduler group, with the per-group
  norms and clip coefficients exposed for logging;
- per-component gradient-norm diagnostics from fnmatch patterns;
- a configurable foreach chunk size;
- partial model-to-master synchronization (whole parameters or selected rows)
  and a partial master check, used after loading a vision tower or
  reinitializing image-token embedding rows.

The shared optimizer is not modified; the logic comes from RustinS's #868/#869
where it lived in moe_optimizer.py.
jason718 added a commit that referenced this pull request Oct 1, 2026
MultimodalOLMoDDPModel wraps a MultimodalLM around an OLMoDDPModel and trains
through the OLMoDDPTrainModule hooks: it feeds the image-spliced embeddings via
`input_embeddings`, forwards `router_loss_div_factor`, and joins the vision
encoder and connector to the LM's multi-group DDP via `apply_dp(root_module=)`.
Given labels it computes the float-weighted, response-only cross entropy (and
z-loss) itself from response-position logits, normalized by the global loss
weight the train module supplies. MultimodalLMConfig.build() returns it for an
OLMoDDPModelConfig language model.

MultimodalLM also gains `encode_images` (reusable image features across
autoregressive forwards), input-scale RMS diagnostics, and a trainable-vision
FLOP estimate. The SigLIP loader, the Molmo2 loader/token additions and the
connector/ViT activation-checkpointing entry points come from RustinS's #869
unchanged.
jason718 added a commit that referenced this pull request Oct 1, 2026
…llbacks and recipe from #869

Squash of two port commits (the first one's tree object was corrupted by an interrupted write).

Port the vision alignment data adapters and evaluators' data layer from #869

The multimodal data package gains RustinS's alignment sources: the document
(native EOS-prefixed) message layout next to the qwen3 one, the
PretrainingReplayDataset that replays a text checkpoint's own pretraining
windows, the perception-phase OCR/audited adapters, strict Arrow-split
validation with content fingerprints, grouped mixture quotas, and the
matching tests. Files that vision had also changed since the fork (#875,
#894) are merged by hand, keeping vision's behavior:

- pixmo_points: `_build_example` accepts both the branch-list convention used
  by vision's stage-1 sources (qwen3 layout, branch weights) and the callable
  convention of the alignment adapters (document layout, strict validation);
  CoSyn keeps the audited-build prefixes and gains split/fingerprint options.
- pixmo_cap: vision's bare style tag and prompt pools stay the default; the
  document layout, transcript validation and length conditioning (opt-in,
  `style_length_conditioning`) are added for the alignment adapters.
- sft_common / sequence_builder / message_sequence: union of both sides
  (epoch-seeded examples from vision, message formats and bounded datasets
  from the alignment recipe).

Two pieces of logic that #868/#869 had placed in shared code move here so the
shared files stay untouched: the per-occurrence metadata alignment for
weighted source mixtures that drop zero-allocation paths (now done by the
replay adapter), and a filesystem cache decorator whose directory comes from
`OLMO_CORE_DATA_VERIFICATION_CACHE_DIR` (`data/multimodal/fs_cache.py`).


Add the OLMoDDP vision alignment train module, callbacks, evaluators and recipe

Builds the three-stage alignment recipe (bridge, perception, joint) from #869
as a multimodal-only layer on the OLMoDDP hooks:

- MultimodalOLMoDDPTrainModule: supplies the weighted response-only loss
  divisor and the valid-token router divisor through
  `_batch_auxiliary_loss_kwargs`; freezes parameters by pattern, restricts
  embedding gradients to the image-token rows, checkpoints frozen parameters
  as `frozen_model.*`, and loads both those checkpoints and native text
  checkpoints (no `lm.` prefix, fresh vision/connector state kept) through
  the `_optimizer_state_dict_for_load` / `_after_load` adapters. Held-out
  multimodal batches return the summed weighted loss; text-only downstream
  batches keep the standard full-logits path.
- train/callbacks/multimodal.py: model initialization from a text checkpoint
  plus a SigLIP tower, the held-out response-loss evaluators, and subclasses
  for W&B run resume and rewritable same-step metric snapshots (with
  `RestoreMetricsCallback`), replacing the shared-callback edits of #868.
- eval/: decoded, academic and fast-text evaluation of alignment checkpoints
  (`scipy` is imported lazily by the pointing metrics).
- internal/vision_alignment*.py and the Vision-Align scripts: the recipe now
  builds `MultimodalOLMoDDPOptimizerConfig`, sets `PYTHONPATH` in its own
  launch env, restores a missing `launch` on config load, and writes
  completion markers through an overwrite-capable helper instead of a
  trainer-wide overwrite policy.

Not carried from #868/#869: the router token mask (padding takes part in
routing statistics), the rowwise-EP forward-only eval dispatch, and the
compiled-flex mask routing; the corresponding tests are dropped.
jason718 added a commit that referenced this pull request Oct 2, 2026
From RustinS's #869: a buffered packing iterator with a resumable per-rank cursor and dataset
fingerprints for the mixture loader, a data-error policy, the document message layout and
PixMo-Cap document format with transcript validation, sampling weights from target loss mass,
per-example deterministic RNG streams, and the collator/packing changes they need. Nothing
here depends on the OLMoDDP hooks or the alignment recipe.
jason718 added a commit that referenced this pull request Oct 2, 2026
Molmo2TokenIds / prepare_molmo2_tokenizer (from #869) so the Molmo2 image tokens can live in
another LM's spare vocabulary rows, and MultimodalLMConfig.molmo2_vision_stack, which pairs
Molmo2-4B's vision tower and connector with an already-built language-model config.
jason718 added a commit that referenced this pull request Oct 2, 2026
… multi-phase pipeline

The parts of RustinS's #869 that the bridge phase does not use: pointing/counting and
FineVision adapters with their image-disjoint selections (vision_alignment_perception,
pixmo_points additions, finevision, fs_cache), the academic/decoded/fast-text evaluation
suites with multimodal decoding, checkpoint and panel helpers, the all-stage pipeline wrapper
and eval script, and the perception/joint visual-source builders registered through
vision_alignment_data.register_phase_sources. Tests: the moved perception/joint recipe tests,
the three-phase override-table check and the suites' own tests.
@jason718
jason718 marked this pull request as draft October 2, 2026 18:30
jason718 added a commit that referenced this pull request Oct 2, 2026
… multi-phase pipeline

The parts of RustinS's #869 that the bridge phase does not use: pointing/counting and
FineVision adapters with their image-disjoint selections (vision_alignment_perception,
pixmo_points additions, finevision, fs_cache), the academic/decoded/fast-text evaluation
suites with multimodal decoding, checkpoint and panel helpers, the all-stage pipeline wrapper
and eval script, and the perception/joint visual-source builders registered through
vision_alignment_data.register_phase_sources. Tests: the moved perception/joint recipe tests,
the three-phase override-table check and the suites' own tests.
jason718 added a commit that referenced this pull request Oct 2, 2026
… multi-phase pipeline

The parts of RustinS's #869 that the bridge phase does not use: pointing/counting and
FineVision adapters with their image-disjoint selections (vision_alignment_perception,
pixmo_points additions, finevision, fs_cache), the academic/decoded/fast-text evaluation
suites with multimodal decoding, checkpoint and panel helpers, the all-stage pipeline wrapper
and eval script, and the perception/joint visual-source builders registered through
vision_alignment_data.register_phase_sources. Tests: the moved perception/joint recipe tests,
the three-phase override-table check and the suites' own tests.
jason718 added a commit that referenced this pull request Oct 2, 2026
… multi-phase pipeline

The parts of RustinS's #869 that the bridge phase does not use: pointing/counting and
FineVision adapters with their image-disjoint selections (vision_alignment_perception,
pixmo_points additions, finevision, fs_cache), the academic/decoded/fast-text evaluation
suites with multimodal decoding, checkpoint and panel helpers, the all-stage pipeline wrapper
and eval script, and the perception/joint visual-source builders registered through
vision_alignment_data.register_phase_sources. Tests: the moved perception/joint recipe tests,
the three-phase override-table check and the suites' own tests.
jason718 added a commit that referenced this pull request Oct 2, 2026
From RustinS's #869, behind opt-in switches so the Molmo2 training scripts load exactly the
same batches as before (verified bitwise on the first Stage-1 and Stage-2 batches):

- MixtureDataLoader(continuous_stream=True): Molmo2's continuous multinomial source stream
  with per-source epochs and a buffered packer whose cursor, buffer and dataset fingerprints
  are saved in state_dict for an exact resume, plus explicit per-group sequence quotas. The
  default keeps the epoch-shuffled order, dataset[index] loading and iter_dynamic_packs,
  with vision's pack_buffer_size=48 / pack_image_weight=30 defaults.
- MixtureDataLoaderConfig, a registered config for the loader.
- MultimodalCollator(batch_metadata=True): router_token_mask, image_crop_counts and
  pooled_token_counts for the OLMoDDP multimodal train module; off by default.
- The document message layout and PixMo-Cap document format with transcript validation
  (the qwen3 layout is unchanged), sampling weights from target loss mass, per-example
  deterministic RNG streams for the document format, and packed-image direct copy.

Nothing here depends on the OLMoDDP hooks or the alignment recipe.
jason718 added a commit that referenced this pull request Oct 2, 2026
Molmo2TokenIds / prepare_molmo2_tokenizer (from #869) so the Molmo2 image tokens can live in
another LM's spare vocabulary rows, and MultimodalLMConfig.molmo2_vision_stack, which pairs
Molmo2-4B's vision tower and connector with an already-built language-model config.
jason718 added a commit that referenced this pull request Oct 2, 2026
… multi-phase pipeline

The parts of RustinS's #869 that the bridge phase does not use: pointing/counting and
FineVision adapters with their image-disjoint selections (vision_alignment_perception,
pixmo_points additions, finevision, fs_cache), the academic/decoded/fast-text evaluation
suites with multimodal decoding, checkpoint and panel helpers, the all-stage pipeline wrapper
and eval script, and the perception/joint visual-source builders registered through
vision_alignment_data.register_phase_sources. Tests: the moved perception/joint recipe tests,
the three-phase override-table check and the suites' own tests.
jason718 added a commit that referenced this pull request Oct 3, 2026
From RustinS's #869, behind opt-in switches so the Molmo2 training scripts load exactly the
same batches as before (verified bitwise on the first Stage-1 and Stage-2 batches):

- MixtureDataLoader(continuous_stream=True): Molmo2's continuous multinomial source stream
  with per-source epochs and a buffered packer whose cursor, buffer and dataset fingerprints
  are saved in state_dict for an exact resume, plus explicit per-group sequence quotas. The
  default keeps the epoch-shuffled order, dataset[index] loading and iter_dynamic_packs,
  with vision's pack_buffer_size=48 / pack_image_weight=30 defaults.
- MixtureDataLoaderConfig, a registered config for the loader.
- MultimodalCollator(batch_metadata=True): router_token_mask, image_crop_counts and
  pooled_token_counts for the OLMoDDP multimodal train module; off by default.
- The document message layout and PixMo-Cap document format with transcript validation
  (the qwen3 layout is unchanged), sampling weights from target loss mass, per-example
  deterministic RNG streams for the document format, and packed-image direct copy.

Nothing here depends on the OLMoDDP hooks or the alignment recipe.
jason718 added a commit that referenced this pull request Oct 3, 2026
Molmo2TokenIds / prepare_molmo2_tokenizer (from #869) so the Molmo2 image tokens can live in
another LM's spare vocabulary rows, and MultimodalLMConfig.molmo2_vision_stack, which pairs
Molmo2-4B's vision tower and connector with an already-built language-model config.
jason718 added a commit that referenced this pull request Oct 3, 2026
… multi-phase pipeline

The parts of RustinS's #869 that the bridge phase does not use: pointing/counting and
FineVision adapters with their image-disjoint selections (vision_alignment_perception,
pixmo_points additions, finevision, fs_cache), the academic/decoded/fast-text evaluation
suites with multimodal decoding, checkpoint and panel helpers, the all-stage pipeline wrapper
and eval script, and the perception/joint visual-source builders registered through
vision_alignment_data.register_phase_sources. Tests: the moved perception/joint recipe tests,
the three-phase override-table check and the suites' own tests.
jason718 added a commit that referenced this pull request Oct 5, 2026
…yout, Molmo2 token ids (#902)

Generic multimodal data/loader infrastructure split out of #869: a mixture loader with an opt-in continuous, resumable buffered stream (dataset fingerprints, per-rank cursor, data-error policy), the document text layout with PixMo-Cap document format, loss-mass sampling weights, Molmo2 token ids and tokenizer preparation for non-Qwen language models, and a factory for the Molmo2-4B vision stack around an existing LM config.

New behaviour is opt-in (continuous_stream=True, batch_metadata=True). With defaults, Molmo2 Stage-1 (default and v3 recipes) and Stage-2 batches are bitwise identical to vision, and Stage-1 GPU runs match vision within run-to-run noise. Known limitation of the opt-in stream tracked in #909.
jason718 added a commit that referenced this pull request Oct 5, 2026
… multi-phase pipeline

The parts of RustinS's #869 that the bridge phase does not use: pointing/counting and
FineVision adapters with their image-disjoint selections (vision_alignment_perception,
pixmo_points additions, finevision, fs_cache), the academic/decoded/fast-text evaluation
suites with multimodal decoding, checkpoint and panel helpers, the all-stage pipeline wrapper
and eval script, and the perception/joint visual-source builders registered through
vision_alignment_data.register_phase_sources. Tests: the moved perception/joint recipe tests,
the three-phase override-table check and the suites' own tests.
jason718 added a commit that referenced this pull request Oct 5, 2026
… multi-phase pipeline

The parts of RustinS's #869 that the bridge phase does not use: pointing/counting and
FineVision adapters with their image-disjoint selections (vision_alignment_perception,
pixmo_points additions, finevision, fs_cache), the academic/decoded/fast-text evaluation
suites with multimodal decoding, checkpoint and panel helpers, the all-stage pipeline wrapper
and eval script, and the perception/joint visual-source builders registered through
vision_alignment_data.register_phase_sources. Tests: the moved perception/joint recipe tests,
the three-phase override-table check and the suites' own tests.
jason718 added a commit that referenced this pull request Oct 5, 2026
… multi-phase pipeline

The parts of RustinS's #869 that the bridge phase does not use: pointing/counting and
FineVision adapters with their image-disjoint selections (vision_alignment_perception,
pixmo_points additions, finevision, fs_cache), the academic/decoded/fast-text evaluation
suites with multimodal decoding, checkpoint and panel helpers, the all-stage pipeline wrapper
and eval script, and the perception/joint visual-source builders registered through
vision_alignment_data.register_phase_sources. Tests: the moved perception/joint recipe tests,
the three-phase override-table check and the suites' own tests.
jason718 added a commit that referenced this pull request Oct 5, 2026
… multi-phase pipeline

The parts of RustinS's #869 that the bridge phase does not use: pointing/counting and
FineVision adapters with their image-disjoint selections (vision_alignment_perception,
pixmo_points additions, finevision, fs_cache), the academic/decoded/fast-text evaluation
suites with multimodal decoding, checkpoint and panel helpers, the all-stage pipeline wrapper
and eval script, and the perception/joint visual-source builders registered through
vision_alignment_data.register_phase_sources. Tests: the moved perception/joint recipe tests,
the three-phase override-table check and the suites' own tests.
jason718 added a commit that referenced this pull request Oct 5, 2026
… multi-phase pipeline

The parts of RustinS's #869 that the bridge phase does not use: pointing/counting and
FineVision adapters with their image-disjoint selections (vision_alignment_perception,
pixmo_points additions, finevision, fs_cache), the academic/decoded/fast-text evaluation
suites with multimodal decoding, checkpoint and panel helpers, the all-stage pipeline wrapper
and eval script, and the perception/joint visual-source builders registered through
vision_alignment_data.register_phase_sources. Tests: the moved perception/joint recipe tests,
the three-phase override-table check and the suites' own tests.
@jason718 jason718 closed this Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants