596 karma · joined March 3, 2016
> This should be mostly mitigated because the base V extension only has the full lane-crossing-gather, hence a lot of software will use lane-crossing operations and force vendors to implement it competitively.
Is that actually what's happening? From the discussion you link (https://github.com/llvm/llvm-project/pull/104574), it seems like the X280 behavior is currently still widespread. Do we know when the competitive perf might materialize?
What makes intrinsics really interesting is that you can use wrapper libraries such as our Highway, then the code actually is portable and efficient.
Does anyone have experience with higher-precision matmul and whether it is worthwhile?
Fair point about the correct rounding. We'd be fine with several ULPs.
[1]: https://www.jstor.org/stable/2157229 [2]: https://www.sollya.org/releases/sollya-8.0/sollya-8.0.pdf
GPU perf/TCO is not always better than CPU, if you can even get enough GPUs, and the latency is also a concern and inducement to do everything on the GPU, which can be limiting.
64-bit OddEven/Reverse2/ConcatOdd/ConcatEven, OddEvenBlocks, SwapAdjacentBlocks, 8-bit Reverse, CombineShiftRightBytes, TableLookupBytesOr0 (=PSHUFB) and Broadcast especially for 8-bit, TwoTablesLookupLanes, InsertBlock, InterleaveLower/InterleaveUpper (=vzip1/2).
All of these are considerably more expensive on RVV. SVE has a nice set, despite also being VL-agnostic.
I agree dispatch should be at a reasonably high level. This hasn't been a problem in my experience, we have been able to inline together most SIMD code and dispatch infrequently.
Espasa discusses this around 6:45 of https://www.youtube.com/watch?v=WzID6kk8RNs.
Agree agnostic would help, but the machine also has to handle SW asking for mask/tail unchanged, right?
RVV does have significant departures from prior work, and some of them are difficult to understand:
- the whole concept of avl, which adds complexity in many areas including reg renaming. From where I sit, we could just use masks instead.
- mask bits reside in the lower bits of a vector, so we either require tons of lane-crossing wires or some kind of caching.
- global state LMUL/SEW makes things hard for compilers and OoO.
- LMUL is cool but I imagine it's not fun to implement reductions, and vrgather.
+1 to dzaima's mention of vrgather. The lack of fixed-pattern shuffle instructions in RVV is absolutely a wrong-instruction issue.
I agree with your point that multiple code variants + runtime dispatch are helpful. We do this with Highway in particular for x86. Users only write code once with portable intrinsics, and the mess of instruction selection is taken care of.