Add Chroma segmented checkpointing support - #2936
Merged
bghira merged 2 commits intoAug 3, 2026
Merged
Conversation
bghira
force-pushed
the
agent/segmented-checkpointing-chroma
branch
from
August 3, 2026 08:50
049853e to
50d8832
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 Chroma model-family integration for segmented gradient checkpointing, including FFN-only checkpointing and attention activation offload support, and wires Chroma into the training safety-check allow-lists. This continues the model-specific extraction from the broader segmented-checkpointing controls work in #2925.
Changes:
- Add Chroma model flags and setters for segmented checkpointing stride and attention activation offload.
- Add FFN-only checkpointing and attention activation offload hooks inside Chroma transformer blocks.
- Extend safety-check allow-lists and model-support tests to include Chroma.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/test_segmented_checkpointing_model_support.py | Adds a Chroma model-family test to assert the new checkpointing/offload controls are exposed. |
| simpletuner/helpers/training/default_settings/safety_check.py | Allows Chroma for segment-stride checkpointing and attention activation offload gating. |
| simpletuner/helpers/models/chroma/transformer.py | Implements Chroma segmented checkpointing stride support, FFN-only checkpointing, and attention activation offload integration. |
Suppressed comments (1)
simpletuner/helpers/models/chroma/transformer.py:1236
- Same as above: this call passes
Trueintoshould_checkpoint_blockwhile also checkingself.gradient_checkpointingseparately. Passingself.gradient_checkpointingdirectly matches the established calling pattern in other model families and keeps the checkpoint gating logic in one place.
use_checkpoint = (
torch.is_grad_enabled()
and self.gradient_checkpointing
and should_checkpoint_block(
index_block,
True,
self.gradient_checkpointing_interval,
self.gradient_checkpointing_segment_stride,
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
1026
to
+1034
| use_checkpoint = ( | ||
| torch.is_grad_enabled() | ||
| and self.gradient_checkpointing | ||
| and (self.gradient_checkpointing_interval is None or index_block % self.gradient_checkpointing_interval == 0) | ||
| and should_checkpoint_block( | ||
| index_block, | ||
| True, | ||
| self.gradient_checkpointing_interval, | ||
| self.gradient_checkpointing_segment_stride, | ||
| ) |
bghira
force-pushed
the
agent/segmented-checkpointing-chroma
branch
3 times, most recently
from
August 3, 2026 10:45
5f258bb to
632edac
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-chroma
branch
from
August 3, 2026 15:30
632edac to
8007ea4
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-chroma
branch
from
August 3, 2026 15:32
8007ea4 to
3531725
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 Chroma segmented checkpointing support model integration out of #2925.
Stack
Base branch:
agent/segmented-checkpointing-boogu-imageValidation
.venv/bin/python -m unittest tests.test_segmented_checkpointing_model_support -v