Skip to content
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

NUM_THREADS leave at least 1 CPU free #5706

Merged
merged 1 commit into from
Nov 18, 2021
Merged

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Nov 18, 2021

Updated strategy leaves at least 1 cpu free to avoid system overloads. Partially addresses #5685

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Improved CPU usage by optimizing the number of utilised threads in data processing.

πŸ“Š Key Changes

  • The computation of NUM_THREADS now reserves one CPU core by subtracting one from os.cpu_count().

🎯 Purpose & Impact

  • πŸ‘©β€πŸ’» Purpose: To prevent the system from becoming unresponsive by avoiding the use of all CPU cores for data processing tasks.
  • πŸ’» Impact: Users may experience smoother multitasking on their systems while running YOLOv5 processes, as there is now a dedicated CPU core for handling other tasks.

Updated strategy leaves at least 1 cpu free to avoid system overloads. Partially addresses #5685
@glenn-jocher glenn-jocher linked an issue Nov 18, 2021 that may be closed by this pull request
2 tasks
@glenn-jocher glenn-jocher self-assigned this Nov 18, 2021
@glenn-jocher glenn-jocher merged commit 8df64a9 into master Nov 18, 2021
@glenn-jocher glenn-jocher deleted the update/num_threads branch November 18, 2021 13:53
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
Updated strategy leaves at least 1 cpu free to avoid system overloads. Partially addresses ultralytics#5685
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

config NUM_THREADS for caching data or make .cache file compatible
1 participant