-
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 crashes in R-4.4.2 for MacOS #1213
Comments
Hi @gilbertocamara , This should be fixed in the current dev version of torch as we explicitly build libtorch without openMP. You can install a pre-built binary with:
or from github with |
Dear @dfalbel many thanks! I downloaded torch using
|
Dear @dfalbel the first option you propose (binary installation) works fine. Many thanks! Do you have an expected date to send it to CRAN? |
Glad it worked out! I plan to submit it soon, probably some time next week. |
Dear @dfalbel as you probably already known,
torch
is crashing in R-4.4.2 for MacOS. The problem is caused because R-4.4 for MacOS now includes an OpenMP library as a common run-time support for the packages that use it. Meanwhile,torch
is also loading its version of OpenMP. Since other R packages in version R-4.4 will now load the OpenMP, a clash of library versions happens, R aborts with the following error message;I asked @s-u (Simon Urbanek, one of the maintainers of R for MacOS) and he provided the following advice:
====
"Any OpenMP-enabled package will trigger the bug. As the error you sent indicated the problem is the incompatibility of the run-time used by torch. If you use any R package with OpenMP support (which loads the official OpenMP run-time - in above example it is data.table) and then run torch afterwards, torch will fail, because it loads its private OpenMP run-time which is incompatible. This is precisely why we provide a common run-time and torch fails to use it so I would recommend filing a bug report with the torch package. It is easily fixed with something like
to point torch to the common run-time which guarantees compatibility between packages. After that fix torch and the above example works again.
The current torch setup essentially means that no one may use OpenMP as it will always clash with its private library (since no one else can use it). Even though it may not bite many people now given the sequence of packages involved, if we decided to enable OpenMP in CRAN build of R then torch won't work at all until this is fixed.
Would you be able to fix this problem? It affects potentially all MacOS
torch
users that upgrade to the latest R version.The text was updated successfully, but these errors were encountered: