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
235 stars 51 forks source link

[Do Not Merge] Preallocate more caches #470

Closed avik-pal closed 5 months ago

avik-pal commented 5 months ago

Testing https://github.com/SciML/SciMLBenchmarks.jl/pull/858

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (e37a60a) 27.90% compared to head (085ba9d) 28.11%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #470 +/- ## ========================================== + Coverage 27.90% 28.11% +0.21% ========================================== Files 27 27 Lines 2118 2134 +16 ========================================== + Hits 591 600 +9 - Misses 1527 1534 +7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

avik-pal commented 5 months ago

These EnumX to Symbol mappings do have some unnecessary overhead, let me track them down

avik-pal commented 5 months ago
julia> @btime solve(prob, $NewtonRaphson(; autodiff = AutoForwardDiff(; chunksize = 2)));
  2.774 μs (46 allocations: 4.55 KiB)

julia> @btime solve(prob, $NewtonRaphson(; autodiff = AutoForwardDiff(; chunksize = 2), linsolve = \));
  3.233 μs (49 allocations: 4.66 KiB)

julia> @btime solve(prob, $NewtonRaphson(; autodiff = AutoForwardDiff(; chunksize = 2), linsolve = GenericLUFactorization()));
  2.620 μs (44 allocations: 4.23 KiB)

julia> @btime solve(prob, $NewtonRaphson(; autodiff = AutoForwardDiff(; chunksize = 2), linsolve = RFLUFactorization()));
  2.607 μs (40 allocations: 3.91 KiB)
avik-pal commented 5 months ago

I don't seem to have caused the Enzyme failures