StaticArrays.jl
StaticArrays.jl copied to clipboard
subset of dimensions known apriori
Does the package support arrays where a subset of dimensions are fixed?
Could you provide some script that you would like to run?
Maybe HybridArrays.jl: https://github.com/JuliaArrays/HybridArrays.jl is what you need?
Mateusz,
Yes, that's it. I'm curious what the performance tradeoffs are between Static, Hybrid and Dynamic. Are there some benchmarks?
Thanks!
On Tue, Aug 23, 2022 at 10:02 AM Mateusz Baran @.***> wrote:
Maybe HybridArrays.jl: https://github.com/JuliaArrays/HybridArrays.jl is what you need?
— Reply to this email directly, view it on GitHub https://github.com/JuliaArrays/StaticArrays.jl/issues/1083#issuecomment-1223702759, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAITKUPIUYELQPKRECOWEXTV2SAPXANCNFSM57IXIGFQ . You are receiving this because you authored the thread.Message ID: @.***>
Any benchmarks would heavily depend on the use case so I think you would have to check on your workflow. HybridArrays are mostly a more convenient variant of the Array-of-SArrays pattern.
I'm doing projective geometry. So I have the first dimension fixed (column vectors) with a variable amount of data. I think the use case fits this Array-of-SArrays problem exactly. But I read that matrix-vector multiplication results in dynamic matrices even though the dimensions can be computed apriori. I also read that it may be important to have the leading dimension be dynamic if LoopVectorization is used, so I wasn't sure of the tradeoffs.
HybridArrays currently doesn't seriously support matrix multiplication but it shouldn't be too hard to add. I was focusing on getindex, setindex and broadcasting along arbitrary dimensions when writing HybridArrays.
Where did you read that the leading dimension should be dynamic for LoopVectorization? For operations I cared about the reverse was true.
Read the last paragraph of the LoopVectorization docs
When using LoopVectorization + HybridArrays, you may often find that you often get the best performance when the leading dimensions are either an even multiple of 8, or relatively large. This will often mean not leading with a small static dimension, which is commonly best practice when not using LoopVectorization.
Tiny Matrix-Vector operations are a very common use case, and there are several expression template libraries for C++ to address it. I think it would be a big value add for these libraries to support it.
Thanks for the link, that's good to know! I don't have the capacity to work on such matrix multiplication myself but I'm open to reviewing and merging changes to HybridArrays.jl that would add it.
I'm not good enough at Julia to try it now. Maybe once I get a better grip....
I'm doing projective geometry. So I have the first dimension fixed (column vectors) with a variable amount of data. I think the use case fits this Array-of-SArrays problem exactly. But I read that matrix-vector multiplication results in dynamic matrices even though the dimensions can be computed apriori. I also read that it may be important to have the leading dimension be dynamic if LoopVectorization is used, so I wasn't sure of the tradeoffs.
On Tue, Aug 23, 2022 at 1:10 PM Mateusz Baran @.***> wrote:
Any benchmarks would heavily depend on the use case so I think you would have to check on your workflow. HybridArrays are mostly a more convenient variant of the Array-of-SArrays pattern.
— Reply to this email directly, view it on GitHub https://github.com/JuliaArrays/StaticArrays.jl/issues/1083#issuecomment-1223915354, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAITKUJJ3JAJPCUUZMX7NVLV2SWTRANCNFSM57IXIGFQ . You are receiving this because you authored the thread.Message ID: @.***>