-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Pattern of the matrix changed #165
Comments
I just fixed this in SciML/OrdinaryDiffEq.jl#1702. Try the newest OrdinaryDiffEq.jl. It seems like the sparsity patterns used to drop zeros here and there before, which is allowed by certain sparsity operations. But now we enabled the reuse of sparse factorizations, we had to get more strict about keeping sparsity patterns the same. This makes the change on 1702 required, and also leads to some nice performance gains. |
Thanks for the quick response! Yep, works now - thanks. |
Yeah sorry about that. When I enabled the "reuse symbolic factorization under sparsity pattern" optimization, I was under the assumption that the solver actually was already doing that, and it did in most cases, but Bruss hit a case where the Jacobian had zeros and some broadcast operations then drop the zeros, and so a weird behavior (JuliaSparse/SparseArrays.jl#190) made that specific case change sparsity patterns, which I never knew until the optimizations that require exactly the same sparsity patterns complained 😅. Anyways, hopefully this quick came out soon enough afterwards that it won't cause a hiccup in the system. |
The new timings on https://diffeq.sciml.ai/stable/tutorials/advanced_ode_example/ are 270ms by default on my computer, so faster than even choosing the right linear solver from before (sans preconditioners). So... hopefully it all works out. I think I got every case, and any case that is "bad" at least throws a safety error. So just let me know if you see the error again. |
Matrix patterns may change for "natural" reasons, consider the porous medium equation
Outside of the support of the solution, only diagonal entries are created. The support widens during evolution, see e.g. here This leads to more and more nonzeros in the matrix during evolution. This seems to be the reason why my VoronoiFVM.jl example for using DifferentialEquations ceased to work... (so far it worked incredibly well, every time beating my simple implcit Euler implementation)... |
Then why not use |
... well indeed the symbolic factorization cannot kept in that case. |
We can follow up in #195 |
This might be related to my previous issue in SciML/OrdinaryDiffEq.jl/#1701. . Again, hard to tell if this is directly a LinearSolve.jl issue or an OrdinaryDiffEq.jl issue. I keep getting random issues with "pattern of the matrix changed" errors. Consider the following example:
Here's the
st
:This also happened on v1.22.2. (It's installed from main directly above since I couldn't seem to
] add
the latest version without specifying it.)You can also get a different error with
KLUFactorization
:I only seem to be getting this with
Rosenbrock
methods, e.g. I can get solutions forRodas4P
andTRBDF2
. Maybe it's similar to SciML/DifferentialEquations.jl#492.The text was updated successfully, but these errors were encountered: