You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following example demonstrates for StaticArrays that DefaultAlgorithmChoice.LUFactorization is significantly slower than explicitly requesting an LUFactorization. The main reason for this is that in
caches =map(first.(EnumX.symbol_map(DefaultAlgorithmChoice.T))) do alg
caches for all possible default algorithms are initialized and not just for the algorithm actually used. The flame graph below shows that over 40% of the time is unnecessarily spent in init_cacheval initializing GMRES, Cholesky-Factorization, SVD and so on. The problem also exists with other types of A and b, albeit to a lesser extent.
It would be great if only the cache for the actual algorithm could be initialized.
I would also be interested to know why a distinction is made between DefaultAlgorithmChoice.LUFactorization and LUFactorization at all.
It's done in that way because with arrays it would be type-unstable to choose the method based on size and such. But with StaticArrays, you have the information. I think we could specialize SArray/MArray directly to LUFactorization/SVDFactorization based on size @avik-pal ?
The following example demonstrates for StaticArrays that
DefaultAlgorithmChoice.LUFactorization
is significantly slower than explicitly requesting anLUFactorization
. The main reason for this is that inLinearSolve.jl/src/default.jl
Line 296 in e60a10a
caches for all possible default algorithms are initialized and not just for the algorithm actually used. The flame graph below shows that over 40% of the time is unnecessarily spent in
init_cacheval
initializing GMRES, Cholesky-Factorization, SVD and so on. The problem also exists with other types of A and b, albeit to a lesser extent.It would be great if only the cache for the actual algorithm could be initialized.
I would also be interested to know why a distinction is made between
DefaultAlgorithmChoice.LUFactorization
andLUFactorization
at all.CC @ranocha
The text was updated successfully, but these errors were encountered: