KEMBAR78
[c10d] ProcessGroupGloo: support per operation timeouts by d4l3k · Pull Request #158128 · pytorch/pytorch · GitHub
Skip to content

Conversation

@d4l3k
Copy link
Member

@d4l3k d4l3k commented Jul 11, 2025

This updates ProcessGroupGloo to support per operation timeouts. Previously the timeouts were ignored even if they were set.

  • This checks if the timeout is kUnsetTimeout and conditionally uses the provided timeout or the default timeout from the context.
  • This exposes set_timeout as a standard method on ProcessGroup/Backend so we can test the global timeout.

Test plan:

pytest test/distributed/test_c10d_gloo.py -v -k allreduce_timeout

cc @H-Huang @awgu @wanchaol @fegin @fduwjj @wz337 @wconstab

@d4l3k d4l3k requested review from H-Huang, fduwjj and kwen2501 July 11, 2025 17:28
@pytorch-bot pytorch-bot bot added oncall: distributed Add this issue/PR to distributed oncall triage queue release notes: distributed (c10d) release notes category labels Jul 11, 2025
@pytorch-bot
Copy link

pytorch-bot bot commented Jul 11, 2025

🔗 Helpful Links

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

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

✅ You can merge normally! (2 Unrelated Failures)

As of commit 2862077 with merge base b4476ca (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

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

Copy link
Member

@H-Huang H-Huang left a comment

Choose a reason for hiding this comment

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

Looks good! Was there any changes needed on the Gloo side? Or was this PR mostly to make sure the plumbing to gloo is correct

Copy link
Member

Choose a reason for hiding this comment

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

maybe add a test case where the collective timeout takes precedence over the pg timeout thats set?

Copy link
Member Author

Choose a reason for hiding this comment

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

done -- I did some cleanups and exposed set_timeout on ProcessGroup/Backend so we could test default operation timeout without causing issues with short timeout during init

Copy link
Member

Choose a reason for hiding this comment

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

where is the timeout from context_->getTimeout() coming from?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is coming from the overall PG timeout that's set when the PG is created. There's a global timeout on the gloo Context

@d4l3k
Copy link
Member Author

d4l3k commented Jul 11, 2025

@H-Huang no Gloo side changes required, just a matter of plumbing things correctly. Was surprised to see that this wasn't plumbed correctly before

@d4l3k d4l3k force-pushed the d4l3k/gloo_timeouts branch from 1a20ccb to ff16b99 Compare July 11, 2025 18:08
Copy link
Contributor

@fduwjj fduwjj left a comment

Choose a reason for hiding this comment

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

make sense and LGTM

@d4l3k d4l3k force-pushed the d4l3k/gloo_timeouts branch from ff16b99 to 8814ea0 Compare July 11, 2025 18:39
@d4l3k d4l3k force-pushed the d4l3k/gloo_timeouts branch from 8814ea0 to 2862077 Compare July 11, 2025 19:38
@d4l3k
Copy link
Member Author

d4l3k commented Jul 11, 2025

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jul 11, 2025
@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

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 mandatory check(s) failed. The first few are:

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@d4l3k
Copy link
Member Author

d4l3k commented Jul 11, 2025

@pytorchbot merge

@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

@d4l3k d4l3k deleted the d4l3k/gloo_timeouts branch July 12, 2025 00:02
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 release notes: distributed (c10d) release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants