Add ERNIE segmented checkpointing support - #2939
Merged
bghira merged 1 commit intoAug 3, 2026
Merged
Conversation
bghira
force-pushed
the
agent/segmented-checkpointing-ernie
branch
from
August 3, 2026 08:50
ce0b3b1 to
647af3e
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 ERNIE-family coverage for the segmented checkpointing feature set introduced in the stacked base branch, ensuring the ERNIE transformer exposes the expected control hooks and is permitted by safety checks.
Changes:
- Add ERNIE to segmented-checkpointing stride allow-lists in safety checks.
- Implement segmented-stride-aware checkpointing decision logic in the ERNIE transformer wrapper (via
should_checkpoint_block) and expose the segment-stride setter. - Expand the segmented checkpointing model-support test suite to include ERNIE.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/test_segmented_checkpointing_model_support.py | Adds ERNIE to the model-family capability coverage tests (expects backend/interval/stride controls). |
| simpletuner/helpers/training/default_settings/safety_check.py | Allows ERNIE in the segment-stride supported model-family list. |
| simpletuner/helpers/models/ernie/transformer.py | Adds segment-stride setter and uses should_checkpoint_block for stride-aware checkpointing decisions; broadens Unsloth backend detection. |
| simpletuner/helpers/models/ernie/transformer_diffusers.py | Broadens Unsloth backend detection to match backend variants (e.g., unsloth-ffn). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bghira
force-pushed
the
agent/segmented-checkpointing-ernie
branch
from
August 3, 2026 09:02
647af3e to
2eca909
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-ernie
branch
from
August 3, 2026 10:45
2eca909 to
714afdf
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-ernie
branch
from
August 3, 2026 15:30
714afdf to
725c0ef
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-ernie
branch
from
August 3, 2026 15:32
725c0ef to
e4946b4
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-ernie
branch
from
August 3, 2026 15:33
e4946b4 to
2d767b7
Compare
bghira
force-pushed
the
agent/segmented-checkpointing-ernie
branch
from
August 3, 2026 15:35
2d767b7 to
ef6cf14
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 ERNIE segmented checkpointing support model integration out of #2925.
Stack
Base branch:
agent/segmented-checkpointing-cosmos3Validation
.venv/bin/python -m unittest tests.test_segmented_checkpointing_model_support -v