Add SanaVideo segmented checkpointing support - #2956
Merged
bghira merged 2 commits intoAug 3, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds SanaVideo model-family integration for the segmented gradient-checkpointing feature set introduced in the stacked base PR, including model hooks, safety-check allow-listing, and targeted tests to validate the wiring.
Changes:
- Implemented segmented checkpointing support in
SanaVideoTransformer3DModel(interval/stride/backend setters + segmented execution path). - Updated safety-check allow-lists so SanaVideo can use
--gradient_checkpointing_intervaland--gradient_checkpointing_segment_stride. - Added/extended unit tests to cover SanaVideo segmented-checkpointing capability flags and the sequential-state helper integration.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
simpletuner/helpers/models/sanavideo/transformer.py |
Adds SanaVideo segmented checkpointing controls and forward-pass integration via checkpoint_sequential_state. |
simpletuner/helpers/training/default_settings/safety_check.py |
Allow-lists sanavideo for interval + segment-stride safety checks. |
tests/test_transformers/test_sanavideo_transformer.py |
Adds a unit test asserting the segmented-checkpointing path calls checkpoint_sequential_state with the expected args. |
tests/test_segmented_checkpointing_model_support.py |
Adds SanaVideo to the model-family capability coverage test matrix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1057
to
+1068
| hidden_states = self._gradient_checkpointing_func( | ||
| block, | ||
| hidden_states, | ||
| attention_mask, | ||
| encoder_hidden_states, | ||
| encoder_attention_mask, | ||
| timestep, | ||
| post_patch_num_frames, | ||
| post_patch_height, | ||
| post_patch_width, | ||
| rotary_emb, | ||
| ) |
bghira
force-pushed
the
agent/segmented-checkpointing-sanavideo
branch
from
August 3, 2026 10:45
6b30d41 to
2ab3ec6
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-sanavideo
branch
from
August 3, 2026 15:30
2ab3ec6 to
aa1a114
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-sanavideo
branch
from
August 3, 2026 15:32
aa1a114 to
3792a6f
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-sanavideo
branch
from
August 3, 2026 15:33
3792a6f to
e066e25
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-sanavideo
branch
from
August 3, 2026 15:35
e066e25 to
fa6597b
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 SanaVideo segmented checkpointing support model integration out of #2925.
Stack
Base branch:
agent/segmented-checkpointing-sanaValidation
.venv/bin/python -m unittest tests.test_segmented_checkpointing_model_support -v.venv/bin/python -m unittest tests.test_transformers.test_sanavideo_transformer -v