Add AuraFlow segmented checkpointing support - #2934
Merged
bghira merged 2 commits intoAug 3, 2026
Merged
Conversation
bghira
force-pushed
the
agent/segmented-checkpointing-auraflow
branch
from
August 3, 2026 08:50
8bb396b to
064d276
Compare
bghira
marked this pull request as ready for review
August 3, 2026 08:53
Contributor
There was a problem hiding this comment.
Pull request overview
Adds AuraFlow support for segmented (stride-window) gradient checkpointing, aligning AuraFlow’s transformer checkpointing behavior with the shared segmented-checkpointing helpers and expanding safety-check allow-list coverage.
Changes:
- Add
gradient_checkpointing_segment_strideplumbing toAuraFlowTransformer2DModeland useshould_checkpoint_block(...)to decide per-block checkpointing. - Treat
unsloth-*checkpoint backends consistently (e.g.,unsloth-ffn) across AuraFlow transformer and ControlNet. - Extend tests and the safety-check allow-list to cover AuraFlow segmented checkpointing controls.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_transformers/test_auraflow_transformer.py | Adds a backward regression test covering joint + single block checkpointing. |
| tests/test_segmented_checkpointing_model_support.py | Asserts AuraFlow exposes segmented checkpointing control setters. |
| simpletuner/helpers/training/default_settings/safety_check.py | Adds AuraFlow to the segment-stride allow-list. |
| simpletuner/helpers/models/auraflow/transformer.py | Implements segment-stride checkpoint selection and forwards attention_kwargs through checkpointed blocks. |
| simpletuner/helpers/models/auraflow/controlnet.py | Updates unsloth backend matching, but checkpointed paths still don’t forward attention_kwargs (see comments). |
Suppressed comments (1)
simpletuner/helpers/models/auraflow/controlnet.py:417
- Same issue in the single-block checkpointed path:
create_custom_forward(block)calls the block positionally, soattention_kwargsis omitted while the non-checkpoint path passes it. This can make outputs differ depending on whether checkpointing is enabled. Wrap the block with acustom_forwardthat forwardsattention_kwargs.
def create_custom_forward(module):
def custom_forward(*inputs):
return module(*inputs)
return custom_forward
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
375
to
379
| @@ -378,7 +378,7 @@ def custom_forward(*inputs): | |||
|
|
|||
| return custom_forward | |||
bghira
force-pushed
the
agent/segmented-checkpointing-auraflow
branch
2 times, most recently
from
August 3, 2026 09:31
0b2742e to
b01c83c
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-auraflow
branch
from
August 3, 2026 10:45
b01c83c to
b7de9cb
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-auraflow
branch
from
August 3, 2026 15:30
b7de9cb to
28c9690
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-auraflow
branch
from
August 3, 2026 15:32
28c9690 to
aebc5f3
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 AuraFlow segmented-checkpointing integration out of #2925.
Stack
Base branch:
agent/segmented-checkpointing-ace-stepValidation
.venv/bin/python -m unittest tests.test_segmented_checkpointing_model_support tests.test_transformers.test_auraflow_transformer -v