-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[wip/exp] Simplify MPS availability check by removing platform dependency #21098
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
Conversation
for more information, see https://pre-commit.ci
"""MPS is only available on a machine with the ARM-based Apple Silicon processors.""" | ||
mps_disabled = os.getenv("DISABLE_MPS", "0") == "1" | ||
return not mps_disabled and torch.backends.mps.is_available() and platform.processor() in ("arm", "arm64") | ||
return not mps_disabled and torch.backends.mps.is_available() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the issue with the current checks?
We cannot easily remove them. MPS marks as available on older intel-based macs as well while not actually accelerating anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is why we add testing back with Intel to see what is happening and if we even have related tests to cover or refuse this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if it passes, it is slower than CPU on intel-macs and due to auto-selection users would end up with a non-optimal backend.
Marking it as ready just to trigger the tests, since it seems that in draft mode not all tests are triggered. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #21098 +/- ##
=======================================
Coverage 87% 87%
=======================================
Files 269 269
Lines 23514 23513 -1
=======================================
+ Hits 20500 20502 +2
+ Misses 3014 3011 -3 |
What does this PR do?
Fixes #<issue_number>
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Reviewer checklist
📚 Documentation preview 📚: https://pytorch-lightning--21098.org.readthedocs.build/en/21098/