Open ericagol opened 4 years ago
Could it help to use StaticArrays?
StaticArrays are very efficient for small sizes, around 16 (so square matrices 4x4 for example). I think they incur in larger compilation latency, if that matters. One useful thing, however, is to have function methods with arguments AbstractArray
, rather than Array
, so that switching from one type to of array to another one is easy, if necessary.
For the Jacobian propagation, should we use views?
This can give a good performance boost: slicing allocates memory because it copies the content of the slice to another part of the memory, while views just access that part of the memory, with no extra allocations.
I've seen some mentions of the MKL linear algebra library being fast. I'm wondering if we should try this out: https://github.com/JuliaLinearAlgebra/MKL.jl
As far as I know, using that package is a bit painful, especially on Windows (never tried myself though).
I'd mention that in Julia v1.7 there will be a much easier mechanism to choose the BLAS library to call (OpenBLAS, MKL, etc), but that's a few months away at the moment.
For the record, here is some preliminary work to make switching to MKL much more seamless: https://github.com/JuliaLinearAlgebra/MKL.jl/pull/63. But as I mentioned above, this will happen with Julia v1.7
Is MKL faster thanks to multi-threading?
We may want to try Octavian.jl
I tried using StaticArrays for the non-gradient code. Little difference in computation time. However, in the future it might be better than using structures to hold pre-allocated arrays that the user doesn't need to access.
Could it help to use StaticArrays?
Might it help to use a more specific type than Real?
For the Jacobian propagation, should we use views?
https://stackoverflow.com/questions/38777469/function-for-reshape-view/38778099