-
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
Changes from all commits
ad1a70a
b29bc5b
ba72d39
a9454a9
94d84a2
9c8345a
f6310f7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ | |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
import os | ||
import platform | ||
from functools import lru_cache | ||
from typing import Optional, Union | ||
|
||
|
@@ -72,7 +71,7 @@ def auto_device_count() -> int: | |
def is_available() -> bool: | ||
"""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 commentThe 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 commentThe 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 commentThe 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. |
||
|
||
@classmethod | ||
@override | ||
|
Uh oh!
There was an error while loading. Please reload this page.