Skip to content

avoid stream synchronization in manager #216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 17, 2025

Conversation

tushar00jain
Copy link
Contributor

@tushar00jain tushar00jain commented Jun 15, 2025

Summary:

  • use a recovery event to synchronize on instead of the recovery stream
  • fix calling work.wait() in manager
  • avoid calling quorum.wait inside of a callback

Test Plan:
Screenshot 2025-06-16 at 1 08 04 AM


Stack created with Sapling. Best reviewed with ReviewStack.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 15, 2025
@tushar00jain tushar00jain force-pushed the pr216 branch 4 times, most recently from 1f93550 to 77b6330 Compare June 16, 2025 07:54
@tushar00jain tushar00jain requested review from d4l3k and H-Huang June 16, 2025 16:13
@tushar00jain tushar00jain marked this pull request as ready for review June 16, 2025 16:13
@@ -323,6 +326,7 @@ def allreduce(
return fut

self.wait_quorum()
Copy link
Member

Choose a reason for hiding this comment

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

do we need this wait_quorum() if self.num_participants() already calls it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think good to leave it here for readability

Summary:
- for diloco the model parameters, in the way they are saved by the test can be different across replicas
- only the global parameters can be the same
- fix the test to validate the global parameters are the same instead of the local model parameters

Test Plan:
```
$ pytest -v ./torchft/local_sgd_integ_test.py::LocalSGDIntegTest::test_diloco_recovery_0
```
Summary:
- use a recovery event to synchronize on instead of the recovery stream
- fix calling `work.wait()` in manager
- avoid calling `quorum.wait` inside of a callback

Test Plan:
<img width="1483" alt="Screenshot 2025-06-16 at 1 08 04 AM" src="https://github.com/user-attachments/assets/47de0853-1878-40b9-ae8e-f9fc55972917" />
Copy link
Member

@d4l3k d4l3k left a comment

Choose a reason for hiding this comment

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

LGTM

@tushar00jain tushar00jain merged commit 9241a8b into pytorch:main Jun 17, 2025
8 checks passed
@tushar00jain tushar00jain deleted the pr216 branch June 17, 2025 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants