mlverse / luz

Higher Level API for torch
https://mlverse.github.io/luz/
Other
85 stars 13 forks source link

Apparent issue with macOS Sonoma 14.4.1 #143

Open DenaJGibbon opened 7 months ago

DenaJGibbon commented 7 months ago

Hello,

I just upgraded to macOS Sonoma 14.4.1, and it appears to have caused a breaking change with the 'luz' setup for multi-class models. Everything was running fine before, and still runs fine on my other computer with an earlier OS. Unfortunately, it does not print out any errors, it just freezes! I have set PYTORCH_ENABLE_MPS_FALLBACK=1 in the R environment, and it prints out the fallback message and then crashes.

The binary example (https://mlverse.github.io/luz/articles/examples/dogs-vs-cats-binary-classification.html) works fine, however the multi-class example (https://mlverse.github.io/luz/articles/examples/mnist-cnn.html) causes problems. This leads me to believe it is something with the 'setup' function. This other multi-class example using 'coro' also runs fine (https://torchvision.mlverse.org/articles/examples/mnist-cnn).

I am not sure if there is other information I could provide to help, and thanks for your hard work on these great tools!

R version 4.3.1 (2023-06-16) Platform: aarch64-apple-darwin20 (64-bit) Running under: macOS Sonoma 14.4.1

torch_0.12.0 torchvision_0.5.1 luz_0.4.0

Update: I updated to R version 4.4.0 (2024-04-24) and get the same error.

DenaJGibbon commented 6 months ago

I found a temporary work around here, by disabling MPS on luz.

https://github.com/mlverse/torch/issues/1167#issuecomment-2121029849

AKALeon commented 4 months ago

Error on M2... Rstudio just crashed