Skip to content

Default to cores/2 threads in JNI layer #6042

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

Closed
wants to merge 1 commit into from

Conversation

GregoryComer
Copy link
Member

Summary:
Default to using cores/2 threadpool threads. The long-term plan is to
improve performant core detection in CPUInfo, but for now we can use cores/2 as a sane default.

Based on testing, this is almost universally faster than using all cores, as efficiency cores can be quite slow. In extreme cases, using
all cores can be 10x slower than using cores/2.

This also matches Lite Interpreter's default behavior when it doesn't have a more precise heuristic for the target hardware.

Differential Revision: D64107326

Copy link

pytorch-bot bot commented Oct 9, 2024

🔗 Helpful Links

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

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

✅ No Failures

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

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

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 9, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D64107326

@GregoryComer GregoryComer added the ciflow/android Trigger Android CI label Oct 9, 2024
GregoryComer added a commit to GregoryComer/executorch that referenced this pull request Oct 9, 2024
Summary:

Default to using cores/2 threadpool threads. The long-term plan is to
improve performant core detection in CPUInfo, but for now we can use cores/2 as a sane default.

Based on testing, this is almost universally faster than using all cores, as efficiency cores can be quite slow. In extreme cases, using
all cores can be 10x slower than using cores/2.

This also matches Lite Interpreter's default behavior when it doesn't have a more precise heuristic for the target hardware.

Differential Revision: D64107326
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D64107326

GregoryComer added a commit to GregoryComer/executorch that referenced this pull request Oct 9, 2024
Summary:

Default to using cores/2 threadpool threads. The long-term plan is to
improve performant core detection in CPUInfo, but for now we can use cores/2 as a sane default.

Based on testing, this is almost universally faster than using all cores, as efficiency cores can be quite slow. In extreme cases, using
all cores can be 10x slower than using cores/2.

This also matches Lite Interpreter's default behavior when it doesn't have a more precise heuristic for the target hardware.

Differential Revision: D64107326
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D64107326

GregoryComer added a commit to GregoryComer/executorch that referenced this pull request Oct 9, 2024
Summary:

Default to using cores/2 threadpool threads. The long-term plan is to
improve performant core detection in CPUInfo, but for now we can use cores/2 as a sane default.

Based on testing, this is almost universally faster than using all cores, as efficiency cores can be quite slow. In extreme cases, using
all cores can be 10x slower than using cores/2.

This also matches Lite Interpreter's default behavior when it doesn't have a more precise heuristic for the target hardware.

Differential Revision: D64107326
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D64107326

@kirklandsign
Copy link
Contributor

Please fix lintrunner

GregoryComer added a commit to GregoryComer/executorch that referenced this pull request Oct 9, 2024
Summary:

Default to using cores/2 threadpool threads. The long-term plan is to
improve performant core detection in CPUInfo, but for now we can use cores/2 as a sane default.

Based on testing, this is almost universally faster than using all cores, as efficiency cores can be quite slow. In extreme cases, using
all cores can be 10x slower than using cores/2.

This also matches Lite Interpreter's default behavior when it doesn't have a more precise heuristic for the target hardware.

Differential Revision: D64107326
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D64107326

GregoryComer added a commit to GregoryComer/executorch that referenced this pull request Oct 9, 2024
Summary:

Default to using cores/2 threadpool threads. The long-term plan is to
improve performant core detection in CPUInfo, but for now we can use cores/2 as a sane default.

Based on testing, this is almost universally faster than using all cores, as efficiency cores can be quite slow. In extreme cases, using
all cores can be 10x slower than using cores/2.

This also matches Lite Interpreter's default behavior when it doesn't have a more precise heuristic for the target hardware.

Differential Revision: D64107326
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D64107326

GregoryComer added a commit to GregoryComer/executorch that referenced this pull request Oct 9, 2024
Summary:

Default to using cores/2 threadpool threads. The long-term plan is to
improve performant core detection in CPUInfo, but for now we can use cores/2 as a sane default.

Based on testing, this is almost universally faster than using all cores, as efficiency cores can be quite slow. In extreme cases, using
all cores can be 10x slower than using cores/2.

This also matches Lite Interpreter's default behavior when it doesn't have a more precise heuristic for the target hardware.

Reviewed By: kirklandsign

Differential Revision: D64107326
Summary:

Default to using cores/2 threadpool threads. The long-term plan is to
improve performant core detection in CPUInfo, but for now we can use cores/2 as a sane default.

Based on testing, this is almost universally faster than using all cores, as efficiency cores can be quite slow. In extreme cases, using
all cores can be 10x slower than using cores/2.

This also matches Lite Interpreter's default behavior when it doesn't have a more precise heuristic for the target hardware.

Reviewed By: kirklandsign

Differential Revision: D64107326
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D64107326

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D64107326

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 27330f2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/android Trigger Android CI CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants