-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Default Automatic Differentiation Choice #353
Comments
Should we just depend on Polyseter and make it the default here?
OrdinaryDiffEq.jl depends on Polyester, and so you might have an odd interaction that some codes work better or worse depending on whether you have the ODE solver loaded, and this might be a little invisible to many users.
Why not Forward? Are you talking about a specific size of the Jacobian? |
I am still debating on the default as polyesterforwarddiff, for the bruss we see a clear improvement but for the battery problem there is a slowdown. I need to investigate this a bit to verify it is not my code that is problematic. |
We could construct the full jacobian and then compute the VJP but the default was based on the implementations available in SparseDiffTools and was not updated after that. Currently we maintain the JacobianOperator in house so we can easily switch that as well. |
The problem is that if there are any other threads then it's not going to be a speedup since you'll lock the threads. This makes it pretty unsafe unless the user knows it's going to be using Polyester. That is why in OrdinaryDiffEq.jl it's always an opt-in (and maybe something we can make into an extension), and I think the same would need to be done here. I think we should highlight it in documentation and tutorials much better than we do now, since indeed for any large enough problem it's a good idea, but it's hard to make something that bypasses hierarchical threading into a default. |
Oh you're talking about the default vjp, for some line searches? |
For some of the line searches and if you use a krylov method like LSMR requiring both |
Do you have a link to the docs for that? We can have it be consistent here |
It's not documented well, and it's used in a very different way. It's just in some methods you can set |
I'm only seeing this now but I want to highlight a caveat. In DI, ReverseDiff is the only package that does support constant arguments but is slowed down significantly by those. The reason is because you can no longer tape anything if the constants change in further function calls. |
Forward AD
AutoPolyesterForwardDiff
(if that package is loaded). This will be similar to SimpleNonlinearSolveReverse AD
AutoReverseDiff
(after implementing the corresponding version in SparseDiffTools) for non-GPU versionsAutoEnzyme
for all other casesThe text was updated successfully, but these errors were encountered: