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

MPSAccelerator not available #13991

Closed
Birch-san opened this issue Aug 2, 2022 · 2 comments · Fixed by #13992
Closed

MPSAccelerator not available #13991

Birch-san opened this issue Aug 2, 2022 · 2 comments · Fixed by #13992
Assignees
Labels
accelerator: mps Apple Silicon GPU bug Something isn't working priority: 0 High priority task
Milestone

Comments

@Birch-san
Copy link
Contributor

Birch-san commented Aug 2, 2022

🐛 Bug

MPSAccelerator can not run on your system since the accelerator is not available. The following accelerator(s) is available and can be passed into accelerator argument of Trainer: ['cpu'].

Raised from accelerator_connector.py::AcceleratorConnector#_set_parallel_devices_and_init_accelerator:
https://github.com/Lightning-AI/lightning/blob/2415834aaf4f215ddb0d618bf415405d670f9114/src/pytorch_lightning/trainer/connectors/accelerator_connector.py

Availability determined here:
https://github.com/Lightning-AI/lightning/blob/2415834aaf4f215ddb0d618bf415405d670f9114/src/pytorch_lightning/accelerators/mps.py

Check is wrong due to platform check here expecting arm (my M1 Max reports platform arm64):
https://github.com/Lightning-AI/lightning/blob/master/src/pytorch_lightning/accelerators/mps.py#L27

image

To Reproduce

from pytorch_lightning import Trainer
Trainer(accelerator='mps')

Expected behavior

Program should complete without raising an error.

Environment

* CUDA:
        - GPU:
        - available:         False
        - version:           None
* Packages:
        - lightning:         2022.8.2
        - lightning_app:     0.5.2
        - numpy:             1.23.0
        - pyTorch_debug:     False
        - pyTorch_version:   1.13.0.dev20220802
        - pytorch-lightning: 1.7.0
        - tqdm:              4.64.0
* System:
        - OS:                Darwin
        - architecture:
                - 64bit
                - 
        - processor:         arm64
        - python:            3.9.12
        - version:           Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000

cc @tchaton @rohitgr7 @akihironitta @justusschock

@Birch-san Birch-san added the needs triage Waiting to be triaged by maintainers label Aug 2, 2022
@Birch-san
Copy link
Contributor Author

I've written a fix:
#13992

@akihironitta akihironitta added bug Something isn't working accelerator: mps Apple Silicon GPU and removed needs triage Waiting to be triaged by maintainers labels Aug 3, 2022
@akihironitta akihironitta added this to the pl:1.7.x milestone Aug 3, 2022
@carmocca carmocca added the priority: 0 High priority task label Aug 3, 2022
@joe-jhou2
Copy link

I caught the same error running the same testing code. Reinstalled the package. nothing changed. Can you advise it? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accelerator: mps Apple Silicon GPU bug Something isn't working priority: 0 High priority task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants