Skip to content

Conversation

@alenawang
Copy link
Contributor

@alenawang alenawang commented Sep 30, 2024

Fixes #132950

This fixes an issue in torch/distributed/elastic/rendezvous/etcd_store.py where the get method does not wait as expected when no keys have been written under the store prefix yet (and therefore the store prefix key does not exist). This was because the _try_wait_get method would error out immediately here if the prefix was not found instead of continuing to the etcd watch.

This was causing upstream issues where distributed jobs using etcd-v2 could not get past the initial rendezvous at all (details in issue #132950).

We added a test demonstrating this issue and the fix. Without the fix the test fails with etcd.EtcdKeyNotFound: Key not found : /torch/elastic/store instead of waiting for the first key to be written; with the fix the test waits properly.

Co-authored-by: tarat44 [email protected]

cc @XilunWu @H-Huang @awgu @kwen2501 @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @c-p-i-o

@pytorch-bot
Copy link

pytorch-bot bot commented Sep 30, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/137056

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit af29007 with merge base c07ebaf (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 30, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@pytorch-bot pytorch-bot bot added oncall: distributed Add this issue/PR to distributed oncall triage queue release notes: distributed (torchelastic) labels Sep 30, 2024
@XilunWu XilunWu requested review from XilunWu, d4l3k and fduwjj September 30, 2024 23:06
@drisspg drisspg added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Oct 1, 2024
Copy link
Contributor

@XilunWu XilunWu left a comment

Choose a reason for hiding this comment

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

The PR looks good to me except some suggestions on lint. Thanks for the fix!!

@alenawang
Copy link
Contributor Author

The PR looks good to me except some suggestions on lint. Thanks for the fix!!

@XilunWu Thank you! Apologies for missing the linter instructions - I ran the linter locally and fixed the issues it was complaining about.

@XilunWu
Copy link
Contributor

XilunWu commented Oct 1, 2024

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 1, 2024
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

AnantGulati pushed a commit to AnantGulati/pytorch that referenced this pull request Oct 2, 2024
…cases (pytorch#137056)

Fixes pytorch#132950

This fixes an issue in `torch/distributed/elastic/rendezvous/etcd_store.py` where the [get method](https://github.com/pytorch/pytorch/blob/v2.4.0/torch/distributed/elastic/rendezvous/etcd_store.py#L60) does not wait as expected when no keys have been written under the store prefix yet (and therefore the store prefix key does not exist). This was because the `_try_wait_get` method would error out immediately [here](https://github.com/alenawang/pytorch/blob/main/torch/distributed/elastic/rendezvous/etcd_store.py#L179) if the prefix was not found instead of continuing to the etcd watch.

This was causing upstream issues where distributed jobs using etcd-v2 could not get past the initial rendezvous at all (details in issue pytorch#132950).

We added a test demonstrating this issue and the fix. Without the fix the test fails with `etcd.EtcdKeyNotFound: Key not found : /torch/elastic/store` instead of waiting for the first key to be written; with the fix the test waits properly.

Co-authored-by: tarat44 <[email protected]>

Pull Request resolved: pytorch#137056
Approved by: https://github.com/fduwjj

Co-authored-by: tarat44 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged oncall: distributed Add this issue/PR to distributed oncall triage queue open source release notes: distributed (torchelastic) triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamic rendezvous with etcd-v2 fails with "etcd.EtcdKeyNotFound: Key not found : /torch/elastic/store"

6 participants