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

ENH: Low memory adjoint #145

Merged
merged 1 commit into from
Mar 5, 2024
Merged

Conversation

inoelloc
Copy link
Contributor

@inoelloc inoelloc commented Mar 5, 2024

This commit is an upgrade of the adjoint model allowing time step checkpoints to lower the maximum memory usage. By default, in the forward sweep of the adjoint, at each time, n arrays of shape (nrow, ncol) where pushed. This arrays were poped at the end of the forward sweep which result in some case (large domain and time steps) to a too high memory peak. This commit adds checkpoints in the forward sweep to reduce the memory peak and pass the variables that must be checkpointed at each time (i.e. fluxes and states) to a vector of active cell instead of a grid of number of rows and columns.

This upgrade should be pretty efficient for large domain and time step calibration

This commit is an upgrade of the adjoint model allowing time step
checkpoints to lower the maximum memory usage. By default, in the
forward sweep of the adjoint, at each time, n arrays of shape (nrow, ncol)
where pushed. This arrays were poped at the end of the forward sweep which
result in some case (large domain and time steps) to a too high memory peak.
This commit adds checkpoints in the forward sweep to reduce the memory peak
and pass the variables that must be checkpointed at each time (i.e. fluxes and
states) to a vector of active cell instead of a grid of number of rows and columns.

This upgrade should be pretty efficient for large domain and time step calibration
@inoelloc inoelloc added the enhancement New feature or request label Mar 5, 2024
@inoelloc inoelloc merged commit ebd49e4 into maintenance/1.0.x Mar 5, 2024
18 checks passed
@inoelloc inoelloc deleted the enh-low-memory-adjoint branch March 5, 2024 10:05
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

Successfully merging this pull request may close these issues.

1 participant