Repository navigation
Molmo2-Stage1: make the data-loader knobs CLI-overridable - #827
Conversation
There was a problem hiding this comment.
💡 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".
| 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 |
There was a problem hiding this comment.
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.
Stacked on #826 (its two commits appear here; review the top commit only).
DATA_PREFETCH_WORKERS,PACK_MAX_CROPS,PACK_BUFFER_SIZEandPACK_IMAGE_WEIGHTwere moduleconstants passed straight into
MixtureDataLoader, so sweeping any of them meant editing thescript. They become
ExperimentConfigfields with identical defaults (4 / 27 / 48 / 1.0), so theCLI 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_weightis the one that had to be pinned to mm_olmo's 1.0rather 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.0each take effect in the built loader.