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

PyTorch #432

Closed
Cat7373 opened this issue Dec 13, 2020 · 24 comments
Closed

PyTorch #432

Cat7373 opened this issue Dec 13, 2020 · 24 comments

Comments

@Cat7373
Copy link

Cat7373 commented Dec 13, 2020

The official name of the app
Pytorch

Is there a supported version available on a stable release channel?
Unknown

Proposed App Status
Unknown

Proposed App Category
Developer Tools

Related Issue Tracker Link or discussion
None

An Official App Download Page
https://pytorch.org

Additional context
None

Full Screenshot with the App and Activity Monitor(if self reporting) or Silicon Info
None

@liyucheng09
Copy link

There are several clues about the supports of pytorch on M1 chip.
Using ARM64 wheel and arm version of Conda: pytorch/pytorch#48145
Still cannot accelerate via neural engine: pytorch/pytorch#47702
It seems that pytorch cannot build from source via python3.9 (universal 2 version, latest release): pytorch/pytorch#44449

@liyucheng09
Copy link

BTW, although pytorch can work "just ok" via M1, many tools are still lack of supports, including Scipy, matplotlib and so on. And IDEs are also far from optimized like Pycharm.

@ThatGuySam
Copy link
Owner

@Cat7373 Thanks for the App Request!

It looks like it's not clear that it works well enough for production on Apple Silicon.

Next we'll need to see if it works via Rosetta 2.

@liyucheng09
Copy link

See: pytorch/pytorch#48524
We can currently install torch with arm version pip; or we can build torch from source nightly.

@ThatGuySam
Copy link
Owner

ThatGuySam commented Dec 17, 2020

Honestly, I'm not super familiar with Pytorch.

Would you say that it can be installed and run as a Python developer would expect it to?

@jjbouza
Copy link

jjbouza commented Dec 17, 2020

I can confirm that pytorch works well under Rosetta. It seems there are still some issues with installing it through pip (at least for me), so developers need to build it from source, which is possible but kind of tricky at the moment since some people are having issues with OpenMP linking. So probably should not be listed as "native" just yet depending on how strict you want to be with that designation

@liyucheng09
Copy link

liyucheng09 commented Dec 18, 2020

I just try on my MacBook Air 13 with M1, and pip works greatly installing pytorch.

liyucheng@liyuchengdeMacBook-Air ~ % which pip3
/Library/Frameworks/Python.framework/Versions/3.9/bin/pip3
liyucheng@liyuchengdeMacBook-Air ~ % pip3 install torch
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting torch
  Downloading https://mirrors.aliyun.com/pypi/packages/79/c8/7f7843dcbaf2263918d257e8022770be577a3d7587dd0ddf8171947eabb4/torch-1.7.1-cp39-none-macosx_10_9_x86_64.whl (110.0 MB)
     |████████████████████████████████| 110.0 MB 142 kB/s 
Collecting typing-extensions
  Downloading https://mirrors.aliyun.com/pypi/packages/60/7a/e881b5abb54db0e6e671ab088d079c57ce54e8a01a3ca443f561ccadb37e/typing_extensions-3.7.4.3-py3-none-any.whl (22 kB)
Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from torch) (1.19.4)
Installing collected packages: typing-extensions, torch
Successfully installed torch-1.7.1 typing-extensions-3.7.4.3
WARNING: You are using pip version 20.2.3; however, version 20.3.3 is available.
You should consider upgrading via the '/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -m pip install --upgrade pip' command.
liyucheng@liyuchengdeMacBook-Air ~ % python3
Python 3.9.0 (v3.9.0:9cf6752276, Oct  5 2020, 11:29:23) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> 

@liyucheng09
Copy link

Note that you should use the latest version python on python.org rather than the python in the Apple CommandLineTools.

@liyucheng09
Copy link

Honestly, I'm not super familiar with Pytorch.

Would you say that it can be installed and run as a Python developer would expect it to?

Yes, but the speed is quite slow than the other neural network platform TensorFlow which is optimized on Apple M1. Therefore, it still needs further updates I think.

@ThatGuySam
Copy link
Owner

App is now live on the site!

https://doesitarm.com/app/pytorch/

We'll keep this issue open for when native Apple Silicon support drops via pip on the stable release channel

@ThatGuySam ThatGuySam changed the title add pytorch PyTorch Dec 18, 2020
@mtrazzi
Copy link

mtrazzi commented Dec 26, 2020

@liyucheng09 have you tried to see if GPU supports work, doing something like this?

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
print('Using device:', device)

@liyucheng09
Copy link

reply to @mtrazzi

>>> import torch
>>> device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
>>> device
device(type='cpu')

@mtrazzi
Copy link

mtrazzi commented Dec 29, 2020 via email

@liyucheng09
Copy link

@mtrazzi It is almost impossible for developers of pytorch to support Apple M1 GPU. So, the best situation I can expect is pytorch can release an original arm version.

@mtrazzi
Copy link

mtrazzi commented Dec 29, 2020 via email

@exgphe
Copy link

exgphe commented Jan 14, 2021

@liyucheng09 have you tried to see if GPU supports work, doing something like this?

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
print('Using device:', device)

@mtrazzi Even on previous Intel-based Macs, Pytorch's support for GPU has been discontinued for years. The official releases of PyTorch for macOS have always been CPU-only.

@iliailmer
Copy link

It is now available through miniforge: pytorch/pytorch#48145 (comment)

@ThatGuySam
Copy link
Owner

@iliailmer So you're saying PyTorch can now be considered working and stable on Apple Silicon?

@iliailmer
Copy link

@ThatGuySam I think so, but I may be wrong. I will be using it myself on my Silicon machine soon and so far I see no reason to believe it is unstable.

@ThatGuySam
Copy link
Owner

ThatGuySam commented Mar 23, 2021

It looks like the ARM64 Binary is also listed here and here

We'll go ahead and upgrade PyTorch to the following status:
✅ Yes, Initial Native Apple Silicon Support for CPU only

And we'll link to the following for updates on GPU support:
pytorch/pytorch#47702

@ThatGuySam
Copy link
Owner

Update is live!

https://doesitarm.com/app/pytorch/

@wojtekcz
Copy link

wojtekcz commented Oct 30, 2021

Something M1 GPU-related is coming...
pytorch/pytorch#47702 (comment)

@heisguyy
Copy link

PyTorch public beta should be available in ~4 months time.

pytorch/pytorch#47702 (comment)

@GeekOfComputer01100101
Copy link

PyTorch public beta should be available in ~4 months time.

SIKE!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants