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

Do not prefer Apple MPS #8446

Merged
merged 1 commit into from
Jul 2, 2022
Merged

Do not prefer Apple MPS #8446

merged 1 commit into from
Jul 2, 2022

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Jul 2, 2022

Require explicit request for MPS, i.e.

python detect.py --device mps

Reverts #8210 for preferring MPS if available.

Note that torch 1.12 MPS is experiencing ongoing compatibility issues in pytorch/pytorch#77886

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhanced device selection in YOLOv5 for better GPU and MPS (Metal Performance Shaders) support.

📊 Key Changes

  • Adjusted conditions for preferring GPU usage to explicitly exclude cases when MPS is chosen.
  • Fixed the condition to explicitly check for MPS preference before defaulting to CPU.

🎯 Purpose & Impact

  • ⚙️ Ensures that when MPS is an option (on compatible macOS devices), it will be used instead of defaulting to CPU automatically.
  • 💡 Provides clearer logic for device selection, potentially improving performance on systems with MPS capability.
  • 🔧 Offers better support for users running YOLOv5 on a wider range of hardware, especially Apple devices with dedicated MPS support.

Require explicit request for MPS, i.e.
```bash
python detect.py --device mps
```

Reverts #8210 for preferring MPS if available. 

Note that torch MPS is experiencing ongoing compatibility issues in pytorch/pytorch#77886
@glenn-jocher glenn-jocher self-assigned this Jul 2, 2022
@glenn-jocher glenn-jocher merged commit 29d79a6 into master Jul 2, 2022
@glenn-jocher glenn-jocher deleted the update/no_mps branch July 2, 2022 16:35
@glenn-jocher glenn-jocher linked an issue Jul 2, 2022 that may be closed by this pull request
2 tasks
@glenn-jocher glenn-jocher mentioned this pull request Jul 2, 2022
2 tasks
@ghost ghost mentioned this pull request Jul 4, 2022
2 tasks
Shivvrat pushed a commit to Shivvrat/epic-yolov5 that referenced this pull request Jul 12, 2022
Require explicit request for MPS, i.e.
```bash
python detect.py --device mps
```

Reverts ultralytics#8210 for preferring MPS if available. 

Note that torch MPS is experiencing ongoing compatibility issues in pytorch/pytorch#77886
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
Require explicit request for MPS, i.e.
```bash
python detect.py --device mps
```

Reverts ultralytics#8210 for preferring MPS if available. 

Note that torch MPS is experiencing ongoing compatibility issues in pytorch/pytorch#77886
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.

Failed to Run WebCam Inference
1 participant