pmwd icon indicating copy to clipboard operation
pmwd copied to clipboard

MLP growth function

Open modichirag opened this issue 2 years ago • 3 comments

With Epod, we now have MLP emulators for growth function that are quite fast. Do we want to include them in official pmwd code, and if so, how? Ideally one would like to keep a way of having both, MLP and odeint the way it is currently implemented, with a way of switching back and forth between them.

I have a sample version that I am currently using, I will create a different branch to push it as an example and we can discuss that further.

modichirag avatar Oct 03 '22 20:10 modichirag

Computing growth is tiny tiny tiny compared to the computational budget of a reasonable sim, no?

EiffL avatar Oct 04 '22 07:10 EiffL

I would personally opt to use proper solvers instead of emulators wherever you can afford it. But that's my preference 😉

EiffL avatar Oct 04 '22 07:10 EiffL

No, I agree with you. But to put things in context

image These are the timings I found for doing a 100 step optimization to get MAP estimate of $A_s$ and $\Omega_m$ parameters with fixed, true IC.

I agree that for any main runs one should use proper solvers. They will also hopefully be of reasonable size and volume where the impact of growth function should be negligible, as you say and as can be seen from the last 256^3 panel. That is why I don't recommend replacing odeint with MLP completely, not even use it as a default choice in the code.

But most of the methodology development, I think, will be done for smaller boxes. From the above figure, 32^3 and 64^3 seem to be completely dominated by growth function. Even for 128^3 there are 2-4x gains with small number of time steps. Hence for developers like us, having an easy access to MLP can be massive time gains.

Currently I have set it up at the UI level in my local branch to look like this

config = Configuration(ptcl_spacing=cell_size, ptcl_grid_shape=(nc,)*3,..., growth_mode='mlp')
config = Configuration(ptcl_spacing=cell_size, ptcl_grid_shape=(nc,)*3, ...,growth_mode='rk4')
config  = Configuration(ptcl_spacing=cell_size, ptcl_grid_shape=(nc,)*3, ...,growth_mode='odeint')

modichirag avatar Oct 04 '22 13:10 modichirag