3 ms·
Julia's SIMD programming model is still very much a work in progress; I think we have a way to go in providing the kind of flexibility and control that language
by staticfloat 6y ago
Julia's SIMD programming model is still very much a work in progress; I think we have a way to go in providing the kind of flexibility and control that languages such as ISPC, Halide, TVM, etc... provide.
That being said, packages such as SIMD.jl [0], and LoopVectorization.jl [1] are making fantastic progress, to the point that LoopVectorization forms the basis of a legitimate BLAS contender, in pure Julia [2]. It's not totally there yet, but it's close enough that real work is being done in LV at OpenBLAS-like speeds.
As an aside, I find it incredible that these kinds of extensions can be built in packages thanks to the fact that Julia's compiler is extensible enough to allow for direct manipulation of the LLVM intrinsics being emitted by user code.
[0] https://github.com/eschnett/SIMD.jl https://github.com/eschnett/SIMD.jl
[1] https://github.com/chriselrod/LoopVectorization.jl https://github.com/chriselrod/LoopVectorization.jl
[2] https://github.com/MasonProtter/Gaius.jl https://github.com/MasonProtter/Gaius.jl
- marmaduke 6y agoIt’s not a jab at Julia, really rather that ISPC provides a workable model that would later on be nice to see elsewhere. > find it incredible that these kinds of extensions can be built in packages thanks to the fact that Julia's compiler is extensible Come on, jeez.. Julia’s compiler is a Lisp-based LLVM driver: of course it can do these things.
- staticfloat 6y ago> It’s not a jab at Julia I didn't take it as such; there are legitimate shortcomings to any tool, I just wanted to provide pointers to other readers that the devs are aware of it, and that there is ongoing development to address it. :) > Come on, jeez.. Julia’s compiler is a Lisp-based LLVM driver: of course it can do these things. As someone who, before Julia, was firmly entrenched in C/C++/Python land, I suppose I am discovering many of these "obvious" things for the first time. :)
- marmaduke 6y ago> I suppose I am discovering many of these "obvious" things sorry for the flippant remark then! it's great to be in discover mode, enjoy ;)
- celrod 6y agoISPC can be really good at SIMD-ing complicated control flow (ray tracers being the archetypal example). I'm interested in eventually working on something like that for Julia. In the mean time, it should be possible to deliberately write code to be compatible with something like SIMD.jl. I think I'd work on a project of trying to get that working via multiple dispatch with at least a moderately complex project, and let those experiences inform the kind of transforms an automatic compiler would need to both work and get good performance.