Skip to content

Molmo2-Stage1: make the data-loader knobs CLI-overridable - #827

Merged
jason718 merged 1 commit into
allenai:visionfrom
jason718:jasonr/stage1-dataloader-knobs
Aug 14, 2026
Merged

jason718 merged 1 commit into
allenai:visionfrom
jason718:jasonr/stage1-dataloader-knobs

Conversation

@jason718

Copy link
Copy Markdown
Contributor

Stacked on #826 (its two commits appear here; review the top commit only).

DATA_PREFETCH_WORKERS, PACK_MAX_CROPS, PACK_BUFFER_SIZE and PACK_IMAGE_WEIGHT were module
constants passed straight into MixtureDataLoader, so sweeping any of them meant editing the
script. They become ExperimentConfig fields with identical defaults (4 / 27 / 48 / 1.0), so the
CLI can reach them.

Motivated by a measurement, not a hypothetical: the 2-node stage-1 baseline on holmes spends
11.4% of step time in data loading (0.213 s of a 1.86 s step, median of the last 50 steps),
which makes prefetch-worker count a real throughput lever. The packer parameters are the other
lever on examples/sec — and pack_image_weight is the one that had to be pinned to mm_olmo's 1.0
rather than the loader's own 30.0 default, so having it visible in the config dump is worth
something on its own.

Behaviour at the defaults is unchanged; this only widens what the CLI can override. Verified that
the defaults still resolve to 4 / 27 / 48 / 1.0 and that --data_prefetch_workers=8 --pack_max_crops=45 --pack_image_weight=10.0 each take effect in the built loader.

@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: c3451fbdf4

ℹ️ 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 +852 to +856
if isinstance(module, ResidualStream):
if module.p > 0.0 or module.masked_dropout > 0.0:
return True
elif isinstance(module, nn.Dropout) and module.p > 0.0:
return 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 RNG for attention dropout

When activation checkpointing is used with AttentionConfig.dropout > 0 and no residual-stream dropout, this scan still returns False: attention dropout is stored as backend.dropout_p when the backend is built (src/olmo_core/nn/attention/__init__.py:472-477) and consumed by SDPA (src/olmo_core/nn/attention/backend.py:415-420), so there is no nn.Dropout submodule for this code to find. In that configuration checkpoint_wrapper still gets preserve_rng_state=False, causing recomputation to draw different attention masks and gradients to differ from the non-checkpointed run.

Useful? React with 👍 / 👎.

`DATA_PREFETCH_WORKERS`, `PACK_MAX_CROPS`, `PACK_BUFFER_SIZE` and
`PACK_IMAGE_WEIGHT` were module constants passed straight to `MixtureDataLoader`,
so they could not be swept without editing the script. They are now
`ExperimentConfig` fields, keeping the same defaults (4 / 27 / 48 / 1.0).

Motivated by a measurement: the 2-node baseline spends **11.4% of step time in
data loading** (0.213 s of a 1.86 s step), which makes prefetch-worker count a real
throughput lever rather than a hypothetical one. The packer parameters are the
other lever on examples/sec, and `pack_image_weight` in particular is the knob that
had to match mm_olmo's 1.0 rather than the loader's own 30.0 default.

Behaviour is unchanged at the defaults; this only widens what the CLI can reach.
Verified: defaults resolve to 4/27/48/1.0 and `--data_prefetch_workers=8
--pack_max_crops=45 --pack_image_weight=10.0` all take effect.
@jason718
jason718 merged commit c54d228 into allenai:vision Aug 14, 2026
1 check passed
@jason718
jason718 deleted the jasonr/stage1-dataloader-knobs branch August 14, 2026 16:08
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