-
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
Performance of tall Jacobians #100
Comments
Here are some thoughts on optimizing |
But isn't traversing the compressed Jacobian slower than traversing the uncompressed? I have no sense how cache locality works for sparse matrices, but to find an element in the sparse matrix a heuristic may be good before starting to traverse the |
Partial fix in PR #146 This adds a fast path that avoids slow sparse indexing if J and sparsity are both SparseMatrixCSC with the same sparsity pattern. Updated timing (Julia 1.6.2) SparseDiffTools.jl v1.14.0:
With PR #146:
and |
Let H be a matrix, x a vector, and f! a matrix-valued function. To make this fit the interface, I allow H to be a vector and reshape H :
Of the 200 variables only the first two are relevant, but even they collapse to one color.
108.402 ms (4 allocations: 160 bytes)
It is still much faster than full ForwardDiff:
2.270 s (6 allocations: 198.39 MiB)
but
@profview forwarddiff_color_jacobian!(jac, f!, x, cache);
shows that most time is spent inFiniteDiff._colorediteration!
.The text was updated successfully, but these errors were encountered: