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

Multi-GPU default to single device 0 #3554

Merged
merged 4 commits into from
Jun 9, 2021
Merged

Multi-GPU default to single device 0 #3554

merged 4 commits into from
Jun 9, 2021

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Jun 9, 2021

Default to device 0 on Multi-GPU systems. This may help prevent instances of DP training when DDP commands should be used for best results. See Multi-GPU Tutorial for full details.

WARNING: BREAKING WORKFLOW CHANGES

  • Previously: all available GPUs were used on Multi-GPU systems if no --device was passed.
  • This update: device 0 will be used by default on Multi-GPU systems if no --device. You now need to opt-in to any GPU groupings using the --device argument, i.e. python train.py --device 0,1,2,3

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Simplified default GPU selection in YOLOv5's device utility.

📊 Key Changes

  • Changed the default GPU device from a range of all available GPUs to just '0' (the first GPU).
  • Adjusted the padding space for better alignment in the printed output.

🎯 Purpose & Impact

  • Ensures a single GPU is used by default, preventing possible unintended use of multiple GPUs when the device is unspecified.
  • Improves the readability of the output by neatly aligning the CUDA device information.
  • This change will mostly affect users who do not specify the GPUs they want to use; it ensures the script doesn't accidentally occupy all available GPUs, which is important for shared systems.

@glenn-jocher glenn-jocher self-assigned this Jun 9, 2021
@glenn-jocher
Copy link
Member Author

/rebase

@glenn-jocher
Copy link
Member Author

glenn-jocher commented Jun 9, 2021

Verification example:
Screenshot 2021-06-09 at 15 18 13

@glenn-jocher glenn-jocher merged commit 8b5086c into master Jun 9, 2021
@glenn-jocher glenn-jocher deleted the default_device0 branch June 9, 2021 13:31
Lechtr pushed a commit to Lechtr/yolov5 that referenced this pull request Jul 20, 2021
* Multi-GPU default to single device 0

* Multi-GPU default to single device 0

* add space

(cherry picked from commit 8b5086c)
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* Multi-GPU default to single device 0

* Multi-GPU default to single device 0

* add space
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.

1 participant