-
Notifications
You must be signed in to change notification settings - Fork 68
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
torch fails on new Mac M3 architecture #1167
Comments
Can you show me the output of |
Sure!
Running a simple command such as
The problems appear on the
Either there is a problem with the |
You might want to try setting the env var |
Also, have you tried installing pre-built binaries from with eg:
|
Thanks! I have tried, but failed. |
Can you also try disabling MPS on luz, just so we can narrow a little more the problem. You can do something like:
|
Works!!! Can we now make |
I think we will need to figure out why torch fails on M3 + MPS for that model. I believe it's possible that you will need to build LibTorch from source to fix this issue. |
How do I build libtorch and liblantern from source? |
To build LibTorch from source, you can follow instructions the steps in this workflow file: https://github.com/mlverse/libtorch-mac-m1/blob/main/.github/workflows/libtorch.yaml Then copy the libtorch files into src/lantern/build and run load_all or dev tools::install with BUILD_LANTERN=1 set. |
Thanks!! I will try |
Dear @dfalbel we tried to build torch from source, but it did not work on Mac M3 chip. Looking at the pytorch github, other developers are having similar problems with the new M3 chip. Please see the following issue: |
Hello. I had a similar issue, but after I upgraded to macOS Sonoma 14.4.1 on a Mac M2. I posted on the Luz GitHub, but was happy to see some discussion here. |
Dear @dfalbel I have bought a new MacBook Air with the M3 chip which has 8 CPUs, 10 GPUs and 16GB integrated memory. My R
torch
apps are crashing. I have put together a MWE which works on all other architectures, including in MacBook Air M1 and MacMini. The OS is the same (Sonoma 14.5). The MWE follows:The error occurs in the
luz::fit
function. Inside RStudio, the code gets stuck and then RStudio asks to restart R. When running R from the terminal, the output is:The
sessionInfo()
output is as follows:The text was updated successfully, but these errors were encountered: