-
Notifications
You must be signed in to change notification settings - Fork 34
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
terra-jupyter-r question about multi-core operations #210
Comments
It looks like this could be addressed in a number of ways (either directly in R, or using conda), by installing OpenBLAS and pointing R to that installation. |
Hey @sjfleming! Sorry I didn't see this until now. I am not sure the answer, but am curious. Do you have any example R code that demonstrates the issue? |
Yeah installing an optimized BLAS sounds like it could be a good idea: https://csantill.github.io/RPerformanceWBLAS/ |
I simply ran in my runtime:
and I now see:
Compared to previous:
So @sjfleming if you add that |
Also (this is a long shot), we recently changed the default notebook runtime in the UI to a 1 CPU machine. So just double-check your runtime actually has >1 CPUs. :) |
You can try |
Hi @rtitle thanks for your response! Yes, I think your Here's an example of a minimal piece of code that demonstrates the difference: m <- matrix(rnorm(9000000), nrow=3000)
d <- solve(m) In my little experiments, this takes about 30 seconds with the current setup, but on a 16-cpu machine with OpenBLAS installed, it runs in about 1 second. If you watch |
Cool, let us know how it goes @sjfleming. I also created a JIRA to track the work if we decide to do this on the Terra side: https://broadworkbench.atlassian.net/browse/IA-2736 |
Alright @rtitle ... I tried interactively running sudo apt-get update
sudo apt-get install -yq --no-install-recommends libopenblas-base inside my docker image (built on top of The following lines in my Dockerfile seem to do the trick (and this time I built the image on top of the current
I assume the same could be done as part of the |
@sjfleming I'm curious if including the line
or the line
before the command
would fix the issue. |
Maybe there was an edit.. sounds like @sjfleming is saying the above lines worked. 🎉 I agree we should fold that in to the |
Thanks @kyuksel , I realized I had screwed with the key I was using for R later on in my image... but if I put the necessary lines before the part where I was messing around later, then it worked alright. I'm grateful for the suggestion though if I run into that again, which I probably will. I never know what to do in those cases, so that's very helpful. @rtitle sounds great! |
Hello! This is a question that's going to be a little bit incomplete... but here it goes:
I have been basing an image off of the
terra-jupyter-r:1.0.4
base image for use in Terra notebooks.I just recently realized that, when I try to run commands like
lmFit()
in thelimma
package (for differential expression analysis), only one processor is being used. When I have set up my own R installations in the past,limma
's differential expression testing has always automatically parallelized itself over all the available cores. Unfortunately I do not understand much about multi-core computing in R... but I have come to rely on that factor of 16 speedup I get on a 16-cpu machine.My question:
Is there something about the R installation in
terra-jupyter-r
that changes a default somewhere for how multi-core operations happen? Something that might have broken the default behavior, which is to parallelize operations over all available cores?(A bit more information... if I would watch processes in
top
in the past, there were two steps where I would see multi-core operations: one would show one process using 1600% compute, and the other operation would show 16 processes each using 100% compute. I am guessing they used different means of parallelizing their operations. But they both work on my own R installation, and they both fail to work (they show one process using 100% compute) onterra-jupyter-r
.Working install shows
terra-jupyter-r:1.0.4
shows)
I am not sure what else to look for!
Any tips would be much appreciated!
The text was updated successfully, but these errors were encountered: