KEMBAR78
Init threadpool with user defined num_threads before default by janeyx99 · Pull Request #136793 · pytorch/pytorch · GitHub
Skip to content

Conversation

@janeyx99
Copy link
Contributor

@janeyx99 janeyx99 commented Sep 26, 2024

Fixes #134714 (or attempts to, idk how to test yet)

For posterity, how one can test:

  1. make sure you have USE_PTHREADPOOL=1 or pull a packaged binary
  2. run gdb --args python, with r to enter, Ctrl-C to pause, and c to get back into Python
  3. import torch
  4. torch.set_num_threads(1), make sure this does not trigger any additional threads getting created.

Stack from ghstack (oldest at bottom):

@pytorch-bot
Copy link

pytorch-bot bot commented Sep 26, 2024

🔗 Helpful Links

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

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

❌ 4 New Failures

As of commit c6b6e0c with merge base a259fbf (image):

NEW FAILURES - The following jobs have failed:

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

@janeyx99 janeyx99 requested a review from malfet September 26, 2024 20:54
Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

Sounds good!
Please double check the behavior locally using gdb

Fixes #134714 (or attempts to, idk how to test yet)




[ghstack-poisoned]
janeyx99 added a commit that referenced this pull request Sep 27, 2024
@janeyx99 janeyx99 added the release notes: cpp release notes category label Sep 27, 2024
@albanD albanD added the topic: bug fixes topic category label Sep 27, 2024
Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

Checked myself locally that this works

@janeyx99
Copy link
Contributor Author

@pytorchbot merge

Thanks @albanD!

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

@janeyx99
Copy link
Contributor Author

@pytorchbot revert -c ghfirst -m "Caused internal Oculus crash, and internal force landed a diff without exporting to GH =.="

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

pytorchmergebot added a commit that referenced this pull request Sep 30, 2024
…136793)"

This reverts commit adbcaee.

Reverted #136793 on behalf of https://github.com/janeyx99 due to Caused internal Oculus crash, and internal force landed a diff without exporting to GH =.= ([comment](#136793 (comment)))
@pytorchmergebot
Copy link
Collaborator

@janeyx99 your PR has been successfully reverted.

Fixes #134714 (or attempts to, idk how to test yet)

For posterity, how one can test:
1. make sure you have USE_PTHREADPOOL=1 or pull a packaged binary
2. run gdb --args python, with `r` to enter, `Ctrl-C` to pause, and `c` to get back into Python
3. import torch
4. torch.set_num_threads(1), make sure this does not trigger any additional threads getting created.




[ghstack-poisoned]
janeyx99 added a commit that referenced this pull request Sep 30, 2024
janeyx99 added a commit that referenced this pull request Oct 1, 2024
@janeyx99
Copy link
Contributor Author

janeyx99 commented Oct 1, 2024

Closing in favor of #137051

@janeyx99 janeyx99 closed this Oct 1, 2024
AnantGulati pushed a commit to AnantGulati/pytorch that referenced this pull request Oct 2, 2024
…ytorch#136793)"

This reverts commit adbcaee.

Reverted pytorch#136793 on behalf of https://github.com/janeyx99 due to Caused internal Oculus crash, and internal force landed a diff without exporting to GH =.= ([comment](pytorch#136793 (comment)))
pytorchmergebot pushed a commit that referenced this pull request Oct 2, 2024
…fault (#137051)

Very similar to #136793, but adds back `pool->set_thread_count` call as it is still necessary (I am guessing due to the mutex)

Fixes #ISSUE_NUMBER

Pull Request resolved: #137051
Approved by: https://github.com/albanD
@github-actions github-actions bot deleted the gh/janeyx99/185/head branch November 3, 2024 02:11
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 release notes: cpp release notes category Reverted topic: bug fixes topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants