Skip to content

Add Sana segmented checkpointing support - #2955

Merged
bghira merged 1 commit into
agent/segmented-checkpointing-qwen-imagefrom
agent/segmented-checkpointing-sana
Aug 3, 2026
Merged

Add Sana segmented checkpointing support#2955
bghira merged 1 commit into
agent/segmented-checkpointing-qwen-imagefrom
agent/segmented-checkpointing-sana

Conversation

@bghira

@bghira bghira commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

Splits the Sana 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-qwen-image

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:32
@bghira
bghira marked this pull request as ready for review August 3, 2026 09:32

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.

🟢 Ready to approve

Changes are small, consistent with existing model-family patterns, and include a targeted unit test plus the required safety-check allow-list update.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Adds Sana model-family support for segmented gradient checkpointing controls by wiring in the shared checkpointing helper logic, enabling the segment-stride knob, and ensuring the model is permitted by the safety-check allow-lists and covered by the model-support test suite.

Changes:

  • Add a Sana-specific segmented checkpointing support test to validate the expected control surface exists.
  • Allow Sana in gradient_checkpointing_segment_stride_supported_models so the CLI/env/WebUI setting can be used without being rejected.
  • Update SanaTransformer2DModel to store/apply gradient_checkpointing_segment_stride and to use should_checkpoint_block(...) for consistent interval/stride checkpoint decisions; broaden Unsloth backend detection to startswith("unsloth").
File summaries
File Description
tests/test_segmented_checkpointing_model_support.py Adds a Sana model-family support test entry for segmented checkpointing controls.
simpletuner/helpers/training/default_settings/safety_check.py Adds sana to the segment-stride gradient checkpointing allow-list.
simpletuner/helpers/models/sana/transformer.py Implements segment-stride state + setter and uses shared checkpointing decision helper; updates Unsloth backend check.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@bghira
bghira force-pushed the agent/segmented-checkpointing-sana branch from fd060a4 to 2af2396 Compare August 3, 2026 10:45
@bghira
bghira force-pushed the agent/segmented-checkpointing-sana branch from 2af2396 to a1321f7 Compare August 3, 2026 15:30
@bghira
bghira force-pushed the agent/segmented-checkpointing-sana branch from a1321f7 to a8dd8ce Compare August 3, 2026 15:32
@bghira
bghira force-pushed the agent/segmented-checkpointing-sana branch from a8dd8ce to 348591b Compare August 3, 2026 15:33
@bghira
bghira force-pushed the agent/segmented-checkpointing-sana branch from 348591b to f141c4e Compare August 3, 2026 15:35
@bghira
bghira merged commit 3504e55 into main Aug 3, 2026
@bghira
bghira deleted the agent/segmented-checkpointing-sana 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