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

Fix autodiff performance #1834

Open
visr opened this issue Sep 23, 2024 · 1 comment
Open

Fix autodiff performance #1834

visr opened this issue Sep 23, 2024 · 1 comment
Labels
core Issues related to the computational core in Julia performance Relates to runtime performance or convergence

Comments

@visr
Copy link
Member

visr commented Sep 23, 2024

We currently default to finite differencing of the Jacobian due to it being much faster, see #1832. Autodiff generally should be more accurate and a bit faster, so perhaps there is some place we need to provide a rule. A profile shows not much difference with autodiff on or off, but there are many more timesteps. Possibly that means that the derivative is wrong, we should check it against finite diff.

@visr visr added performance Relates to runtime performance or convergence core Issues related to the computational core in Julia labels Sep 23, 2024
@visr
Copy link
Member Author

visr commented Sep 23, 2024

While working on #1835 I saw something strange. The backwater model tests started failing with finite diff. The actual heads were just over a meter higher on the upstream end, but were similar on the downstream end. I set backwater to use autodiff for now, but we should look into this later. It could also be some interaction with standard_step_method.

ManningResistance: Test Failed at /home/runner/work/Ribasim/Ribasim/core/test/run_models_test.jl:509
  Expression: all(isapprox.(h_expected, h_actual; atol = 0.02))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues related to the computational core in Julia performance Relates to runtime performance or convergence
Projects
Status: To do
Development

No branches or pull requests

1 participant