Closed ferrolho closed 2 years ago
Can you isolate this to a Jacobian which is different? I cannot find a case so it's a bit odd, but it could just be a missing case.
Yes, sorry. I do recognise that what I posted above is very little info. I am trying to do that now.
I just tested the behaviour in other more simple problems and I didn't see any numerical differences there, so it must be quite specific...
Yeah. I know v1.16.2 had an issue, so maybe you were accidentally testing that? The OrdinaryDiffEq tests picked it up though, and v1.16.3 was the hotfix (and that was rather specific). But v1.16.3 got through all of the DiffEq tests just fine, and that tests dense and sparse, so I would be surprised if there was something still missing. That said, there definitely could such a case.
This is something on v1.16.3. When I was rolling back the releases one by one, I did go through v1.16.2, which for my same problem was crashing the solver; but the hotfix changed that.
I've found the specific lines causing this.
If I revert https://github.com/JuliaDiff/SparseDiffTools.jl/blob/47a8a9f4725e1ca8b07d5d17a8e674dd2718292d/src/differentiation/compute_jacobian_ad.jl#L320-L326 to https://github.com/JuliaDiff/SparseDiffTools.jl/blob/fb09091c195311ab622ced4889694e889631c980/src/differentiation/compute_jacobian_ad.jl#L287 the behaviour remains the same.
hmm, that looks correct. What if you remove the ivdep
?
Interesting. Just removing ivdep
fixes the issue. I'm not familiar with what that keyword is used for, though.
It should be safe if not aliasing, but apparently there's still a memory connection in here? Do a PR to remove it.
If not aliasing what? I've submitted the PR.
two different arrays in the loop
Thank you for your help, Chris. Prompt as always! :rackauckas:
Hi! I am using
ForwardColorJacCache
,matrix_colors
, andforwarddiff_color_jacobian!
in my project. I am solving an optimisation problem and I useforwarddiff_color_jacobian!
to evaluate jacobians using forward-mode automatic differentiation.The changes to SparseDiffTools.jl introduced in
v1.16.2
andv1.16.3
have changed the optimiser's behaviour significantly. Below you can find the iteration logs of the solver before and after the update.Using
v1.16.1
:Using
v1.16.3
:I am not sure why this is happening...