Skip to content

Remove OrdinaryDiffEq internals #1784

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

Closed
wants to merge 14 commits into from

Conversation

SouthEndMusic
Copy link
Collaborator

@SouthEndMusic SouthEndMusic marked this pull request as draft September 2, 2024 03:53
@SouthEndMusic
Copy link
Collaborator Author

SouthEndMusic commented Oct 25, 2024

Things I changed:

  • Replace LineSearches.jl by LineSearch.jl (part of SciML). Specifically, I use LineSearch.BackTracking instead of my wrapper of LineSearches.BackTracking. It might turn out that this wrapper is still needed.
  • Use the latest master of OrdinaryDiffEq.jl (I had quite some problems installing directly from the GitHub repository, so I now use a path to the repo locally as a POC). Using NonlinearSolveAlg now works with finite difference, but using ForwardDiff is still broken. OrdinaryDiffEqRosenbrock is also broken.

It must be noted that even though NonlinearSolveAlg with finite difference and BackTracking from LineSearch.jl works, I observed a huge drop in performance for the HWS model. Interestingly, looking at the profile reveals that this performance drop is at least in part due to runtime dispatch and allocations in OrdinaryDiffEqNonlinearSolve, so that subpackage is clearly not mature enough to be used.

@visr visr force-pushed the remove_ordinarydiffeq_internals branch from 20ac189 to 34218fd Compare April 8, 2025 12:30
visr added a commit that referenced this pull request Apr 8, 2025
Helps to reduce the allocations:
```
# 17.378027 seconds (5.23 M allocations: 3.301 GiB, 2.81% gc time)
# 16.907372 seconds (4.01 M allocations: 3.255 GiB, 2.47% gc time)
```

The remaining allocations are almost all in relaxation, for which #2190
or #1784 are good candidates to help.

```julia
using Ribasim
m = Ribasim.Model("hws_2025_4_0/hws.toml")
@profview_allocs Ribasim.solve!(m)
```


![image](https://github.com/user-attachments/assets/d79515a1-1c37-4a25-9f37-1cb8c9868dcf)
@visr visr moved this to 🏗 In progress in Ribasim Apr 10, 2025
@visr visr added this to Ribasim Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Get rid of OrdinaryDiffEq internals usage
1 participant