Skip to content

feat(FSDP): enable FSDP strategy on CPU and add trainable checkpointing tests#21840

Open
zhixiangli wants to merge 4 commits into
Lightning-AI:masterfrom
zhixiangli:feature/fsdp-cpu
Open

feat(FSDP): enable FSDP strategy on CPU and add trainable checkpointing tests#21840
zhixiangli wants to merge 4 commits into
Lightning-AI:masterfrom
zhixiangli:feature/fsdp-cpu

Conversation

@zhixiangli

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #21812

Before submitting
  • Was this discussed/agreed via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

Reviewer checklist
  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

@codecov-commenter

codecov-commenter commented Jul 17, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79%. Comparing base (7f0c343) to head (a3e129a).
✅ All tests successful. No failed tests found.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

❗ There is a different number of reports uploaded between BASE (7f0c343) and HEAD (a3e129a). Click for more details.

HEAD has 1379 uploads less than BASE
Flag BASE (7f0c343) HEAD (a3e129a)
cpu 371 60
python 18 3
lightning_fabric 131 0
pytest 176 0
python3.12 130 21
python3.12.7 54 9
python3.13 112 18
lightning 93 15
python3.11 37 6
python3.10 20 3
pytorch2.1 20 6
pytest-full 195 60
pytorch2.2.2 9 3
pytorch2.8 22 6
pytorch_lightning 147 45
pytorch2.12 20 6
pytorch2.11 21 6
pytorch2.10 19 6
pytorch2.13 19 6
pytorch2.5.1 9 3
pytorch2.7 9 3
pytorch2.9 19 6
pytorch2.4.1 9 3
pytorch2.3 10 3
pytorch2.6 9 3
Additional details and impacted files
@@            Coverage Diff            @@
##           master   #21840     +/-   ##
=========================================
- Coverage      87%      79%     -8%     
=========================================
  Files         270      267      -3     
  Lines       24069    24011     -58     
=========================================
- Hits        20904    18868   -2036     
- Misses       3165     5143   +1978     

zhixiangli and others added 4 commits July 22, 2026 12:28
This enables using FSDP strategy with `accelerator="cpu"`, which is useful for CPU-based FSDP checkpoint benchmarking and testing.

Also updated CHANGELOG.md and added tests.

TAG=agy
CONV=0b443e3e-6fbb-468a-9f11-b99f211cf34b
TAG=agy
CONV=e53a2100-ddf2-4298-b123-6e1312841db7
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.

Enable FSDP strategy on CPU (accelerator="cpu")

2 participants