Skip to content

Add Z-Image segmented checkpointing support - #2960

Merged
bghira merged 2 commits into
agent/segmented-checkpointing-wanfrom
agent/segmented-checkpointing-z-image
Aug 3, 2026
Merged

Add Z-Image segmented checkpointing support#2960
bghira merged 2 commits into
agent/segmented-checkpointing-wanfrom
agent/segmented-checkpointing-z-image

Conversation

@bghira

@bghira bghira commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

Splits the Z-Image 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-wan

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 Z-Image model-family integration for segmented gradient checkpointing controls introduced in the stacked base PR, including runtime hooks/flags, safety-check allow-listing, and a targeted support test to ensure the model exposes the required checkpointing control surface.

Changes:

  • Add Z-Image checkpointing hooks/flags for interval + segment stride, FFN-only checkpointing scope, and attention activation offload in the Z-Image transformer.
  • Allow-list z_image for segmented checkpointing and attention activation offload in safety checks.
  • Extend the segmented-checkpointing model-support test suite to cover ZImageTransformer2DModel.

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 a model-support test asserting Z-Image exposes the expected checkpointing control surface.
simpletuner/helpers/training/default_settings/safety_check.py Allow-lists z_image for segmented checkpointing and attention activation offload safety validation.
simpletuner/helpers/models/z_image/transformer.py Implements interval/stride segmented checkpointing path and attention/FFN boundary hooks for Z-Image.

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

Comment thread simpletuner/helpers/models/z_image/transformer.py
@bghira
bghira force-pushed the agent/segmented-checkpointing-z-image branch from d826739 to f493302 Compare August 3, 2026 10:45
@bghira
bghira force-pushed the agent/segmented-checkpointing-z-image branch from f493302 to a3e96c3 Compare August 3, 2026 15:30
@bghira
bghira force-pushed the agent/segmented-checkpointing-z-image branch from a3e96c3 to 8d55441 Compare August 3, 2026 15:32
@bghira
bghira force-pushed the agent/segmented-checkpointing-z-image branch from 8d55441 to 743aaab Compare August 3, 2026 15:33
@bghira
bghira force-pushed the agent/segmented-checkpointing-z-image branch from 743aaab to b51487d Compare August 3, 2026 15:35
@bghira
bghira merged commit 3504e55 into main Aug 3, 2026
4 checks passed
@bghira
bghira deleted the agent/segmented-checkpointing-z-image 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