Skip to content
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

Create out-of-place workflow #21

Open
JordiBolibar opened this issue Aug 3, 2023 · 3 comments
Open

Create out-of-place workflow #21

JordiBolibar opened this issue Aug 3, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@JordiBolibar
Copy link
Member

Right now everything is implemented in-place in order to be memory efficient for the PDE solving. This is great for the forward PDE runs, but we need an out-of-place version to be run with AD, particularly for ReverseDiff.jl.

This implies to basically reproduce the same workflow as in place, changing all functions like SIA2D! -> SIA2D, to indicate that it's out-of-place. All the code is available in the current ODINN.jl repo.

@JordiBolibar JordiBolibar added the enhancement New feature or request label Aug 3, 2023
@facusapienza21
Copy link
Member

I implemented this is my Huginn.jl fork using the out-of-place implementation of the PDE (no UDE) forward model. This consisted in creating the same functions for the in-place case but without with out-of-place evaluation. Now two set of separate test are being run

@testset "Halfar Solution (in-place)" halfar_test(; rtol=0.02, atol=1.0, inplace=true)

@testset "Halfar Solution (out-of-place)" halfar_test(; rtol=0.02, atol=1.0, inplace=false)

We can see the difference in performance between the two methods using BenchmarkTools.jl. This first example is using the in-place option:
Screen Shot 2023-08-07 at 6 28 40 PM

And the same ODE problem but with out-of-place allocation memory:
Screen Shot 2023-08-07 at 6 29 23 PM

We can see the difference in memory storage. However, what I find odd is that the in-place method is just slightly faster than the out-of-place... I was expecting the difference between the two to be more notorious.

Between the functions I implemented for the out-of-place we have

  • run\_0(). Ideally this should be called just run`, but that is an existing function in Julia base. Any suggestion for a better name?
  • simulate_iceflow_PDE()
  • initialize_iceflow_model()
  • SIA()
  • avg_surface_velocity()
  • surface_V()

facusapienza21 added a commit to facusapienza21/Huginn.jl that referenced this issue Aug 8, 2023
@JordiBolibar
Copy link
Member Author

@facusapienza21 We should post this on Discourse in order to better understand why the in-place workflow doesn't provide a significant speed up wrt the out-of-place. There are clear differences in memory usage, though.

@JordiBolibar
Copy link
Member Author

@facusapienza21 What's the status on this? Have you created the Discourse post?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants