Skip to content

Add Wan segmented checkpointing support - #2959

Merged
bghira merged 2 commits into
agent/segmented-checkpointing-stable-cascadefrom
agent/segmented-checkpointing-wan
Aug 3, 2026
Merged

Add Wan segmented checkpointing support#2959
bghira merged 2 commits into
agent/segmented-checkpointing-stable-cascadefrom
agent/segmented-checkpointing-wan

Conversation

@bghira

@bghira bghira commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

Splits the Wan segmented checkpointing support model integration out of #2925.

  • applies the model-family checkpointing hooks and support flags
  • adds this family to the relevant safety-check allow-lists
  • keeps the shared runtime/docs in the base PR so this diff stays model-specific

Stack

Base branch: agent/segmented-checkpointing-stable-cascade

Validation

  • .venv/bin/python -m unittest tests.test_segmented_checkpointing_model_support -v
  • commit hooks: Black, isort, flake8, whitespace checks

@bghira
bghira requested a review from Copilot August 3, 2026 09:33
@bghira
bghira marked this pull request as ready for review August 3, 2026 09:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Wan-family (Wan + WanS2V) integration points for segmented gradient checkpointing, aligning these models with the shared segmented-checkpointing runtime introduced in the stacked base branch.

Changes:

  • Added Wan and WanS2V to the segmented-checkpointing capability test suite.
  • Extended Wan transformer implementation with segmented checkpointing support, FFN-only checkpointing plumbing, and optional attention activation offload scoping.
  • Updated training safety-check allow-lists to recognize wan and wan_s2v for interval/stride controls (and wan for attention activation offload).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/test_segmented_checkpointing_model_support.py Adds Wan/WanS2V capability assertions for segmented checkpointing controls.
simpletuner/helpers/training/default_settings/safety_check.py Allows Wan/WanS2V families through safety gates for segmented checkpointing interval/stride (and Wan for attention offload).
simpletuner/helpers/models/wan/transformer.py Implements segmented checkpointing execution path and adds FFN checkpoint + attention offload scope support flags/controls.
simpletuner/helpers/models/wan_s2v/transformer.py Wires interval/stride-aware block checkpoint selection and aligns some attention/rotary-embedding handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

offload=False,
ffn=False,
attention_offload=False,
)
@bghira
bghira force-pushed the agent/segmented-checkpointing-wan branch from 2afe350 to 03b4e90 Compare August 3, 2026 10:33
@bghira
bghira force-pushed the agent/segmented-checkpointing-wan branch from 03b4e90 to b071e7f Compare August 3, 2026 10:45
@bghira
bghira force-pushed the agent/segmented-checkpointing-wan branch from b071e7f to 5dd9e18 Compare August 3, 2026 15:30
@bghira
bghira force-pushed the agent/segmented-checkpointing-wan branch from 5dd9e18 to 3d5d449 Compare August 3, 2026 15:32
@bghira
bghira force-pushed the agent/segmented-checkpointing-wan branch from 3d5d449 to b2d16aa Compare August 3, 2026 15:33
@bghira
bghira force-pushed the agent/segmented-checkpointing-wan branch from b2d16aa to 4088ddc Compare August 3, 2026 15:35
@bghira
bghira merged commit 3504e55 into main Aug 3, 2026
2 checks passed
@bghira
bghira deleted the agent/segmented-checkpointing-wan branch August 3, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants