SciML / DiffEqFlux.jl

Pre-built implicit layer architectures with O(1) backprop, GPUs, and stiff+non-stiff DE solvers, demonstrating scientific machine learning (SciML) and physics-informed machine learning methods
https://docs.sciml.ai/DiffEqFlux/stable
MIT License
865 stars 153 forks source link

fix: dependency management #936

Closed avik-pal closed 3 weeks ago

avik-pal commented 1 month ago
avik-pal commented 1 month ago

The remaining failures are from the broken Forward Mode in SciMLSensitivity https://github.com/SciML/SciMLSensitivity.jl/issues/1099.

avik-pal commented 1 month ago

Still lets wait for the upstream fixes to land before moving ahead with this

ChrisRackauckas commented 1 month ago

Well the upstream fixes are in but 😅. Though I will say I did see this come up when playing around. This is why I asked:

Did ComponentArrays of Tracker always store as Array{TrackedReal} or did it create TrackedArray with views of TrackedArray on sub parts?

When doing ArrayInterface.restructure for the SciMLStructures compatibility, I noticed that TrackedArrays and ComponentArrays didn't mix well. In particular, a TrackedArray on a ComponentArray had the wrappers the wrong way around, and so the indexing didn't work out. And the other way seemed to not make the ComponentArray of TrackedArray structure, but instead TrackedReals. But I know you had to have tried this with Lux before so it must be a recent regression? So what you're seeing there is precisely ArrayInterface.restructure(x::ComponentArray, y::SomethingTracked) going awry, and fixing that behavior is the fix. We don't have a test for that exact case in SciMLSensitivity though, would probably be good to add.

avik-pal commented 1 month ago

So what you're seeing there is precisely ArrayInterface.restructure(x::ComponentArray, y::SomethingTracked) going awry, and fixing that behavior is the fix.

This is not hard to fix, I will do it in ComponentArrays

avik-pal commented 1 month ago

Once https://github.com/jonniedie/ComponentArrays.jl/pull/269 lands, tests should be green again!