Skip to content

Set default ATen threading backend to native if USE_OPENMP is false#43067

Closed
malfet wants to merge 1 commit intopytorch:masterfrom
malfet:malfet/use-native-aten-backend-on-mac
Closed

Set default ATen threading backend to native if USE_OPENMP is false#43067
malfet wants to merge 1 commit intopytorch:masterfrom
malfet:malfet/use-native-aten-backend-on-mac

Conversation

@malfet
Copy link
Copy Markdown
Contributor

@malfet malfet commented Aug 14, 2020

Since OpenMP is not available on some platforms, or might be disabled by user, set default ATEN_THREADING based on USE_OPENMP and USE_TBB options

Fixes #43036

@malfet malfet requested a review from pbelevich August 14, 2020 19:26
Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@malfet has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Copy Markdown
Contributor

@pbelevich pbelevich left a comment

Choose a reason for hiding this comment

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

There should be a simple unit-test that calls checks something like 'ATen parallel backend: OpenMP' in torch.__config__.parallel_info() for Linux and Windows and 'ATen parallel backend: native thread pool' in torch.__config__.parallel_info() for macOS

Maybe it should run only during the release

@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented Aug 14, 2020

💊 CI failures summary and remediations

As of commit 5d14fe5 (more details on the Dr. CI page):


  • 1/1 failures possibly* introduced in this PR
    • 1/1 non-CircleCI failure(s)

ci.pytorch.org: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 5 times.

@malfet
Copy link
Copy Markdown
Contributor Author

malfet commented Aug 14, 2020

@pbelevich I don't think we should have this one as a unit test since developer should be free to compile PyTorch with TBB or with OpenMP on Mac using a custom clang build. But we should add this to release runbook.

@malfet malfet requested a review from pbelevich August 14, 2020 21:02
Since OpenMP is not available on some platforms, or might be disabled by user during configuration, set ATEN_THREADING default based on USE_OPENMP and USE_TBB options
@malfet malfet force-pushed the malfet/use-native-aten-backend-on-mac branch from 7550265 to 5d14fe5 Compare August 14, 2020 23:33
@malfet malfet changed the title Set ATen threading backend to native by default on MacOS Set ATen threading backend to native by default if USE_OPENMP is false Aug 14, 2020
@malfet malfet changed the title Set ATen threading backend to native by default if USE_OPENMP is false Set defalt ATen threading backend to native if USE_OPENMP is false Aug 14, 2020
Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@malfet has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@malfet malfet changed the title Set defalt ATen threading backend to native if USE_OPENMP is false Set default ATen threading backend to native if USE_OPENMP is false Aug 14, 2020
@malfet malfet deleted the malfet/use-native-aten-backend-on-mac branch August 17, 2020 17:35
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@malfet merged this pull request in 034e672.

laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
…ytorch#43067)

Summary:
Since OpenMP is not available on some platforms, or might be disabled by user, set default `ATEN_THREADING` based on USE_OPENMP and USE_TBB options

Fixes pytorch#43036

Pull Request resolved: pytorch#43067

Reviewed By: houseroad

Differential Revision: D23138856

Pulled By: malfet

fbshipit-source-id: cc8f9ee59a5559baeb3f19bf461abbc08043b71c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PyTorch binaries for macOS has serial at::parallel_for because it is built with OpenMP which is not available

4 participants