Add Flux segmented checkpointing support - #2940
Merged
bghira merged 2 commits intoAug 3, 2026
Merged
Conversation
bghira
force-pushed
the
agent/segmented-checkpointing-flux
branch
from
August 3, 2026 08:50
11168d5 to
43e165d
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 Flux-family support for the segmented-checkpointing feature set introduced in the base branch, wiring Flux’s transformer blocks into stride-based segmented checkpointing and attention activation offload, and extending the safety-check allow-lists and model-support tests accordingly.
Changes:
- Add Flux block plumbing for attention activation offload (
activation_offload_context) and propagate offload flags through checkpointed and non-checkpointed execution paths. - Add Flux segmented-checkpointing stride handling within the transformer block loops.
- Extend safety-check allow-lists and add unit tests validating Flux exposes the expected checkpointing controls and block call signatures.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/test_segmented_checkpointing_model_support.py |
Adds Flux coverage to the model-support assertions and verifies Flux blocks accept FFN-checkpoint and attention-offload flags. |
simpletuner/helpers/training/default_settings/safety_check.py |
Adds flux to the segmented-stride and attention-activation-offload allow-lists. |
simpletuner/helpers/models/flux/transformer.py |
Implements Flux attention activation offload plumbing and stride-aware segmented checkpointing behavior. |
Suppressed comments (1)
simpletuner/helpers/models/flux/transformer.py:1419
- Same issue as above: the return_dict branch in create_custom_forward does not pass offload_attention, so attention activation offload is disabled when return_dict is set.
if return_dict is not None:
return module(*inputs, return_dict=return_dict)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
1250
to
1251
| if return_dict is not None: | ||
| return module(*inputs, return_dict=return_dict) |
bghira
force-pushed
the
agent/segmented-checkpointing-flux
branch
from
August 3, 2026 09:02
43e165d to
8ce0266
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-flux
branch
from
August 3, 2026 10:45
828bf68 to
562eb6f
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-flux
branch
from
August 3, 2026 15:30
562eb6f to
3911e5c
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-flux
branch
from
August 3, 2026 15:32
3911e5c to
d9ee1dc
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-flux
branch
from
August 3, 2026 15:33
d9ee1dc to
3856384
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-flux
branch
from
August 3, 2026 15:35
3856384 to
3316163
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 Flux segmented-checkpointing integration out of #2925.
Stack
Base branch:
agent/segmented-checkpointing-ernieValidation
.venv/bin/python -m unittest tests.test_segmented_checkpointing_model_support -v