SciML / LinearSolve.jl

LinearSolve.jl: High-Performance Unified Interface for Linear Solvers in Julia. Easily switch between factorization and Krylov methods, add preconditioners, and all in one interface.
https://docs.sciml.ai/LinearSolve/stable/
Other
244 stars 52 forks source link

Improve Enzyme rules with less copying #380

Open ChrisRackauckas opened 12 months ago

ChrisRackauckas commented 12 months ago

Right now in order to make the first pass of the Enzyme rule there's a lot of defensive copying. I think we can get away with less by putting a good rule over setproperty!(linsolve, ...), since if it knows just when to copy there, it can ensure that the linsolve in reverse is "fixed" as it goes backwards. That would mean that the other rules would not need to copy each time in case of a change, since we would instead be public API point where it can change.

wsmoses commented 11 months ago

Yeah I that's correct.