feat: use DI for structured Jacobians#470
Conversation
|
Structure is indeed preserved for decompression (on the SparseMatrixColorings PR branch at least). |
| fu = f(u, p) | ||
| if SciMLBase.has_jac(f) || SciMLBase.has_vjp(f) || SciMLBase.has_jvp(f) | ||
| return JacobianCache{false}(u, f, fu, u, p, stats, autodiff, nothing, nothing) | ||
| return JacobianCache{false}(u, f, fu, u, p, stats, autodiff, nothing) |
There was a problem hiding this comment.
Same question about cases where DI preparation is skipped
There was a problem hiding this comment.
Only where the user provides an analytic jacobian. This one is a special case for scalars when DI is skipped if jacobian/jvp/vjp is provided.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Seems to work beautifully. Haven't benchmarked yet, but the important part here is to ensure structure is preserved, since the main cost in these workloads is that Linear solving will be bottlnecked if a banded matrix is converted into a sparse matrix.