Add Sana segmented checkpointing support - #2955
Merged
bghira merged 1 commit intoAug 3, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Ready to approve
Changes are small, consistent with existing model-family patterns, and include a targeted unit test plus the required safety-check allow-list update.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
Adds Sana model-family support for segmented gradient checkpointing controls by wiring in the shared checkpointing helper logic, enabling the segment-stride knob, and ensuring the model is permitted by the safety-check allow-lists and covered by the model-support test suite.
Changes:
- Add a Sana-specific segmented checkpointing support test to validate the expected control surface exists.
- Allow Sana in
gradient_checkpointing_segment_stride_supported_modelsso the CLI/env/WebUI setting can be used without being rejected. - Update
SanaTransformer2DModelto store/applygradient_checkpointing_segment_strideand to useshould_checkpoint_block(...)for consistent interval/stride checkpoint decisions; broaden Unsloth backend detection tostartswith("unsloth").
File summaries
| File | Description |
|---|---|
| tests/test_segmented_checkpointing_model_support.py | Adds a Sana model-family support test entry for segmented checkpointing controls. |
| simpletuner/helpers/training/default_settings/safety_check.py | Adds sana to the segment-stride gradient checkpointing allow-list. |
| simpletuner/helpers/models/sana/transformer.py | Implements segment-stride state + setter and uses shared checkpointing decision helper; updates Unsloth backend check. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
bghira
force-pushed
the
agent/segmented-checkpointing-sana
branch
from
August 3, 2026 10:45
fd060a4 to
2af2396
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-sana
branch
from
August 3, 2026 15:30
2af2396 to
a1321f7
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-sana
branch
from
August 3, 2026 15:32
a1321f7 to
a8dd8ce
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-sana
branch
from
August 3, 2026 15:33
a8dd8ce to
348591b
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-sana
branch
from
August 3, 2026 15:35
348591b to
f141c4e
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 Sana segmented checkpointing support model integration out of #2925.
Stack
Base branch:
agent/segmented-checkpointing-qwen-imageValidation
.venv/bin/python -m unittest tests.test_segmented_checkpointing_model_support -v