Intel SPMD Program Compiler: A Compiler for High-Performance SIMD Programming
ispc.github.io
ispc.github.io
I found them extremely interesting - highly recommended.
That said, as I understand things, vectorization can fail with Cuda if you allocate more kernels than exist on the chip, in which case the chip may run the kernels in serial, producing surprising results.
Together with a parallel-for from, for example, Intel's TBB library would make it parallel.
Making a new language imposes a huge development cost. Code will have to be adjusted.
Although the story is interesting, especially with notes on company politics, it is a bit one-sided on the technical side. The compiler-chiefs might have had a point that went beyond 'politics'.
I rewrote some OpenCL kernels for ISPC and it was a great experience. The resulting shared object could just be loaded and called from ctypes in Python, where OpenCL requires a lot of rituals.
Switching lane size doesn't make much sense to me because ideally you would want lanes that are as wide as possible and mostly be agnostic to their size.
Writing it out like that, it sounds like it should have been easy. Don't remember what I ran into. Maybe didn't bang on it long enough.
But Intel's history when it comes to compilers and applied optimisations leaves this making me immediately uncomfortable.
The sort of PR work that these guys would need to do in order for me to consider them even remotely trustworthy is beyond even their budget.
Not sure what conclusions to draw from that, but it looks like ARM support was finally made first class this past August: https://github.com/ispc/ispc/blob/cf90189/docs/ReleaseNotes....
I think it might be difficult to purposefully cripple AMD in an open source project.
It's not as explicit as it has been in the past, but the CPUID checks for very specific feature sets aligned with particular Intel models may not match AMD models, producing worse code on AMD models that support featuresets above baseline AVX2:
https://github.com/ispc/ispc/blob/master/check_isa.cpp#L106-...
That said, I don't assume malice here and I haven't investigated thoroughly. Most likely they just want to support their own silicon well and that's what they know. It's possible they would accept similar support for AMD µarchs in the OSS project (or maybe not).
I wouldn't draw too much inference from the ARM example, as I don't see ARM as an Intel competitor. AMD, on the other hand, is currently very competitive with Intel.
Interestingly, Intel people don't necessarily have the information to optimize for Intel CPUs even, and the hardware may not tell you. It's really complicated and messy. An example that's relevant to linear algebra is figuring out whether to use FMA, e.g. https://github.com/jeffhammond/vpu-count
You can compare it to other detection functions - one relatively easy to read, non-vendor biased example that does dig into all the extensions is this Go implementation (not mine): https://github.com/klauspost/cpuid/blob/master/cpuid.go
Zen1-2 should land on the "AVX 2 (Haswell)" path in the linked excerpt -- they have AVX/AVX2, F16C, OSXSAVE, and RDRAND -- which is the best ISA without AVX512 implemented in the compiler. That's entirely reasonable on Intel's part.
(I don't know why they look for RDRAND in a compiler, but whatever.)
Agreed. ISPC is under a BSD license, but I wonder if there's a lawsuit to be made from the use of the techniques.
A benchmark whose speed also depends on a compiler is not a benchmark of the CPU, but of a combination compiler/CPU. If this is not written down (and, of course, also written down which compiler was used), it is a deception of the reader.
This in and of itself is not proof that they are operating in bad faith; if they provide clean interfaces and reasonable default implementations that's all that can be justifiably expected of them.
The question of good faith actually only comes into play when another vendor provides their own optimised implementations and creates a pull request.
How will the project maintainers respond? Even getting to that point requires a trust based buy in to the project from the other vendor.
Given Intel's history of toxic behaviour in competition I think they need to do far more than they have done (and are likely to ever do) to earn that minimal baseline of trust.