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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: MPS not working properly on pytorch 1.12 #150

Closed
lsickert opened this issue Dec 9, 2022 · 1 comment 路 Fixed by #151
Closed

Bug: MPS not working properly on pytorch 1.12 #150

lsickert opened this issue Dec 9, 2022 · 1 comment 路 Fixed by #151
Labels
bug Something isn't working

Comments

@lsickert
Copy link
Collaborator

lsickert commented Dec 9, 2022

馃悰 Bug Report

As long as pytorch 1.12 is still used (basically until 1.13.1 comes out), the "mps" backend seems to be too unstable to use it, failing several of the tests. Even setting PYTORCH_ENABLE_MPS_FALLBACK=1 in the environment does not fully remove this issue.

馃敩 How To Reproduce

Steps to reproduce the behavior:

  1. run make fast-test (or any other command) on macOS with "mps" support

Environment

  • OS: macOS
  • Python version: 3.9.7

馃搱 Expected behavior

Tests should run successfully

馃搸 Additional context

A quickfix would be to set the default device in inseq.utils.torch_utils.py to "cpu" for mps-environments as well for now, until pytorch 1.13.1 is released.

def get_default_device() -> str:
    if is_cuda_available() and is_cuda_built():
        return "cuda"
    elif is_mps_available() and is_mps_built():
        return "cpu"
    else:
        return "cpu"
@lsickert lsickert added the bug Something isn't working label Dec 9, 2022
@github-actions
Copy link

github-actions bot commented Dec 9, 2022

Hello @lsickert, thank you for your interest in our work!

If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

@lsickert lsickert linked a pull request Dec 12, 2022 that will close this issue
11 tasks
@lsickert lsickert removed a link to a pull request Dec 16, 2022
11 tasks
@lsickert lsickert linked a pull request Dec 16, 2022 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant