Skip to content

Make FSDP quorum recovery state-safe - #347

Open
Skuld7451 wants to merge 2 commits into
meta-pytorch:mainfrom
Skuld7451:upstream-fsdp-safe-recovery
Open

Skuld7451 wants to merge 2 commits into
meta-pytorch:mainfrom
Skuld7451:upstream-fsdp-safe-recovery

Conversation

@Skuld7451

@Skuld7451 Skuld7451 commented Aug 19, 2026

Copy link
Copy Markdown

Summary

  • allow selected state-dict callbacks to run on the training thread
  • add first-quorum ordering so recovery state is sourced consistently
  • make FSDP peer healing safe from out-of-phase replica-local collectives

Closes #343

Related work

Draft PR #112 addresses one part of this problem: it waits for the first quorum
before forward can run. This PR has the same ordering requirement when
init_sync=True; unlike #112, it preserves asynchronous startup when
init_sync=False.

The remaining changes in this PR are FSDP-specific and are not covered by #112:

  • synchronize replica-local process-group setup before checkpoint transfer;
  • assign all local ranks of a recovering replica to the same source replica;
  • materialize collective FSDP state on the training thread; and
  • isolate state reads from optimizer updates and queued device work.

If #112 lands first, this PR can rebase on it and remove the overlapping
first-quorum wait after the unconditional versus init_sync-gated behavior is
resolved. The FSDP recovery changes above remain necessary independently.

Dependencies

Testing

python -m pytest -q \
  torchft/manager_test.py \
  torchft/optim_test.py \
  torchft/checkpointing/http_transport_test.py
40 passed, 1 skipped

cargo test test_compute_quorum_results
4 passed

@meta-cla

meta-cla Bot commented Aug 19, 2026

Copy link
Copy Markdown

Hi @Skuld7451!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

This branch has not been deployed

No deployments
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.

[RFC] Make FSDP quorum recovery state-safe

1 participant