Add Cosmos 3 segmented checkpointing support - #2938
Merged
bghira merged 1 commit intoAug 3, 2026
Merged
Conversation
bghira
force-pushed
the
agent/segmented-checkpointing-cosmos3
branch
from
August 3, 2026 08:50
727f96b to
9ccda17
Compare
bghira
marked this pull request as ready for review
August 3, 2026 08:52
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Cosmos 3 into the segmented gradient-checkpointing feature surface by wiring the model’s checkpointing decision logic into the shared should_checkpoint_block helper, exposing the segment-stride setter, and extending safety-check allow-lists. Also adds targeted unit coverage to ensure Cosmos 3 advertises the expected checkpointing controls and that unpatchify preserves/propagates prediction dtypes correctly.
Changes:
- Add
gradient_checkpointing_segment_stridesupport toCosmos3OmniTransformerand route layer checkpoint decisions throughshould_checkpoint_block(...). - Extend safety-check allow-lists to recognize
cosmos3for interval/segment-stride checkpointing settings. - Add unit tests for Cosmos 3 segmented-checkpointing capability flags and for
_unpatchify_and_unpack_latentsdtype behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/test_segmented_checkpointing_model_support.py |
Adds a Cosmos 3 capability test ensuring the model exposes interval + segment-stride checkpointing hooks. |
tests/test_cosmos3_model.py |
Adds regression tests validating _unpatchify_and_unpack_latents preserves or adopts the materialized latent dtype. |
simpletuner/helpers/training/default_settings/safety_check.py |
Adds cosmos3 to the checkpointing segment-stride supported model allow-list (and confirms interval support in-file). |
simpletuner/helpers/models/cosmos3/transformer.py |
Implements segment-stride setter/state and uses shared should_checkpoint_block logic for per-layer checkpoint decisions; updates unpatchify output dtype selection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bghira
force-pushed
the
agent/segmented-checkpointing-cosmos3
branch
from
August 3, 2026 09:02
9ccda17 to
178cd2b
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-cosmos3
branch
from
August 3, 2026 10:45
178cd2b to
aeeb013
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-cosmos3
branch
from
August 3, 2026 15:30
aeeb013 to
f2f8806
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-cosmos3
branch
from
August 3, 2026 15:32
f2f8806 to
a8ba193
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-cosmos3
branch
from
August 3, 2026 15:33
a8ba193 to
520f70d
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-cosmos3
branch
from
August 3, 2026 15:35
520f70d to
a97b54e
Compare
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.
Summary
Splits the Cosmos 3 segmented checkpointing support model integration out of #2925.
Stack
Base branch:
agent/segmented-checkpointing-cosmosValidation
.venv/bin/python -m unittest tests.test_segmented_checkpointing_model_support -v.venv/bin/python -m unittest tests.test_cosmos3_model -v