-
Notifications
You must be signed in to change notification settings - Fork 8
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
EM Efficiency vs. INLA #27
Comments
Hi Steven,
Thank you for bringing this to our attention. The EM version should not
generally take longer than INLA. Dan has been working on the EM
implementation and knows the most about its efficiency under different
conditions, but he is currently out on vacation. Is this something that can
wait a week or so until he gets back? We will definitely address it, as
one of the motivations for the EM implementation is efficiency!
18 hours is a very long time compared with what we generally expect. This
is a plot based on a simulation study from Dan's draft manuscript, and you
can see that with 10000 vertices and 8 tasks, we start to see the EM
computation time suffer, but nothing like 18 hours...
[image: image.png]
Could this subject be an anomaly, or are you seeing similar runtimes for
other subjects? There are three factors that might be at play:
the relatively high number of tasks, the relatively high spatial
resolution, and possibly a lack of data (few time points) associated with
each task. There are a few things you can try and other things that we can
implement to improve on this. On your end, you could pool the tasks so you
only have 2 conditions, as you suggested. If you'd rather keep the 8
conditions separate, you could also reduce resolution down to 5000 vertices
– though I don't expect that will help quite as much as reducing the number
of tasks. On our end, we could allow for the spatial hyperparameters to be
shared across tasks. That should greatly improve computational efficiency,
because computation time is very affected by the number of hyperparameters
in the model. And, perhaps more importantly, convergence could be really
slow if there is too little data to estimate the hyperparameters for
individual tasks. We might be able to build in a flag for cases like this
where pooling hyperparameters across the tasks might be recommendable.
Mandy
*Mandy Mejia, PhD*
Assistant Professor
Department of Statistics
Indiana University
https://www.statmindlab.com/
…On Wed, Jul 20, 2022 at 11:38 AM Steven Meisler ***@***.***> wrote:
Hi,
I know the benchmarking in the BayesfMRI paper used the INLA
implementation, but I have been testing the EM version (2.0 latest commit)
and have been getting very long run times compared to the published
benchmarks.
I am running on a CentOs7 HPC, using 32 CPUs / 100GB RAM. A single
hemisphere took ~18 hours to process for a single HPC subject resampled to
10000 vertices. Max memory usage was around 28GB.
My run is pretty much identical to the vignette with the exception that I
am running on the HCP working memory N-back task, and thus have 8
conditions of interest (4 conditions for 2-back and 0-back each).
Is this to be expected, and are there any ways I can speed up the run? For
example, if I only ran two conditions (pool all the 2-back and 0-back
conditions together), would I expect to see speed increases? I would prefer
not to resample further, and I imagine I will get diminishing returns on
adding CPUs.
The results look great, by the way! Plotted below is a single subject
2-back vs 0-back, plotted against the HCP group level analysis. Thanks
again for all of your work in developing this!
[image: image]
<https://user-images.githubusercontent.com/27028726/180036170-2766055d-08d2-42b5-bd91-2cd5e24c056e.png>
[image: image]
<https://user-images.githubusercontent.com/27028726/180036212-76332bb9-9c2a-4325-b5d8-c520833f3de8.png>
Best,
Steven
—
Reply to this email directly, view it on GitHub
<#27>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHVKUWNSLYICIQRC4EUSYTVVATQFANCNFSM54ELFJCA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Just a quick follow-up – I misspoke about EM not taking longer than INLA.
Under some conditions it clearly does as you can see in the plot I sent.
But we wouldn't expect it to take THAT much longer.
*Mandy Mejia, PhD*
Assistant Professor
Department of Statistics
Indiana University
https://www.statmindlab.com/
…On Thu, Jul 21, 2022 at 8:53 AM Amanda Mejia ***@***.***> wrote:
Hi Steven,
Thank you for bringing this to our attention. The EM version should not
generally take longer than INLA. Dan has been working on the EM
implementation and knows the most about its efficiency under different
conditions, but he is currently out on vacation. Is this something that can
wait a week or so until he gets back? We will definitely address it, as
one of the motivations for the EM implementation is efficiency!
18 hours is a very long time compared with what we generally expect. This
is a plot based on a simulation study from Dan's draft manuscript, and you
can see that with 10000 vertices and 8 tasks, we start to see the EM
computation time suffer, but nothing like 18 hours...
[image: image.png]
Could this subject be an anomaly, or are you seeing similar runtimes for
other subjects? There are three factors that might be at play:
the relatively high number of tasks, the relatively high spatial
resolution, and possibly a lack of data (few time points) associated with
each task. There are a few things you can try and other things that we can
implement to improve on this. On your end, you could pool the tasks so you
only have 2 conditions, as you suggested. If you'd rather keep the 8
conditions separate, you could also reduce resolution down to 5000 vertices
– though I don't expect that will help quite as much as reducing the number
of tasks. On our end, we could allow for the spatial hyperparameters to be
shared across tasks. That should greatly improve computational efficiency,
because computation time is very affected by the number of hyperparameters
in the model. And, perhaps more importantly, convergence could be really
slow if there is too little data to estimate the hyperparameters for
individual tasks. We might be able to build in a flag for cases like this
where pooling hyperparameters across the tasks might be recommendable.
Mandy
*Mandy Mejia, PhD*
Assistant Professor
Department of Statistics
Indiana University
https://www.statmindlab.com/
On Wed, Jul 20, 2022 at 11:38 AM Steven Meisler ***@***.***>
wrote:
> Hi,
>
> I know the benchmarking in the BayesfMRI paper used the INLA
> implementation, but I have been testing the EM version (2.0 latest commit)
> and have been getting very long run times compared to the published
> benchmarks.
>
> I am running on a CentOs7 HPC, using 32 CPUs / 100GB RAM. A single
> hemisphere took ~18 hours to process for a single HPC subject resampled to
> 10000 vertices. Max memory usage was around 28GB.
>
> My run is pretty much identical to the vignette with the exception that I
> am running on the HCP working memory N-back task, and thus have 8
> conditions of interest (4 conditions for 2-back and 0-back each).
>
> Is this to be expected, and are there any ways I can speed up the run?
> For example, if I only ran two conditions (pool all the 2-back and 0-back
> conditions together), would I expect to see speed increases? I would prefer
> not to resample further, and I imagine I will get diminishing returns on
> adding CPUs.
>
> The results look great, by the way! Plotted below is a single subject
> 2-back vs 0-back, plotted against the HCP group level analysis. Thanks
> again for all of your work in developing this!
> [image: image]
> <https://user-images.githubusercontent.com/27028726/180036170-2766055d-08d2-42b5-bd91-2cd5e24c056e.png>
> [image: image]
> <https://user-images.githubusercontent.com/27028726/180036212-76332bb9-9c2a-4325-b5d8-c520833f3de8.png>
>
> Best,
> Steven
>
> —
> Reply to this email directly, view it on GitHub
> <#27>, or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ABHVKUWNSLYICIQRC4EUSYTVVATQFANCNFSM54ELFJCA>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
|
Thanks for the suggestions! Definitely no rush to address this, and I will try pooling across conditions and testing a different subject as well. |
Hey @smeisler , just checking in to see if you saw similar runtimes with other subjects. Did you try pooling across conditions? Happy to help now that I'm back! |
Hi, I have not tried this yet, but I will update when I do. |
Getting back to this, I retried INLA after grouping together the 0- and 2-back conditions and changing variable names (see #28), and the program crashes with the following error message (on both HCP subjects I tested):
Restarting with EM implementation and will update when that finishes. |
The EM implementation was notably quicker. The run time was 58 and 67 minutes for the two subjects. |
Hi @smeisler , do you have a reproducible example that I can use to try to figure this out? I am unable to reproduce this error. Glad to hear that the EM is working for you, though! |
Yes, this is using HCP1200 data, very similar to the vignette, but using the working memory task and grouping 0- and 2-back conditions together. Just make sure to change the two
|
Hi,
I know the benchmarking in the BayesfMRI paper used the INLA implementation, but I have been testing the EM version (2.0 latest commit) and have been getting very long run times compared to the published benchmarks.
I am running on a CentOs7 HPC, using 32 CPUs / 100GB RAM. A single hemisphere took ~18 hours to process for a single HPC subject resampled to 10000 vertices. Max memory usage was around 28GB.
My run is pretty much identical to the vignette with the exception that I am running on the HCP working memory N-back task, and thus have 8 conditions of interest (4 conditions for 2-back and 0-back each).
Is this to be expected, and are there any ways I can speed up the run? For example, if I only ran two conditions (pool all the 2-back and 0-back conditions together), would I expect to see speed increases? I would prefer not to resample further, and I imagine I will get diminishing returns on adding CPUs.
The results look great, by the way! Plotted below is a single subject 2-back vs 0-back, plotted against the HCP group level analysis. Thanks again for all of your work in developing this!


Best,
Steven
The text was updated successfully, but these errors were encountered: