Conversation
|
|
|
You can run the benchmark on x86_64 with: and on aarch64 with: |
|
Do you want to take a look? @AntoinePrv |
|
@ursabot please benchmark lang=C++ |
|
Benchmark runs are scheduled for commit f85237b. Watch https://buildkite.com/apache-arrow and https://conbench.arrow-dev.org for updates. A comment will be posted here when the runs are complete. |
| } | ||
|
|
||
| MinMax FindMinMaxAvx2(const int16_t* levels, int64_t num_levels) { | ||
| return avx2::FindMinMaxImpl(levels, num_levels); |
There was a problem hiding this comment.
Is FindMinMaxImpl still in the codebase? If so, can we remove it?
There was a problem hiding this comment.
It cannot be removed, ARROW_USER_SIMD_LEVEL=NONE would still require it.
| namespace parquet::internal { | ||
|
|
||
| template <typename Arch> | ||
| MinMax FindMinMaxSimd(const int16_t* levels, int64_t num_levels) { |
There was a problem hiding this comment.
@AntoinePrv Do you want to take a look at this implementation?
There was a problem hiding this comment.
Looks reasonable to me. Cannot say if it is optimal (perhaps a manual unroll could help because of the loop-carried dependency, but perhaps the compiler can tell it is associative), but if it improves then it's good!
We might be able to get a generic version of this in https://github.com/xtensor-stack/xsimd-algorithm (yet to put proper benchmarks and all).
There was a problem hiding this comment.
The ursabot never finished, so please run
build/release/parquet-arrow-reader-writer-benchmark \
--benchmark_filter='BM_ReadColumn<true,'
I would like to see some independent numbers.
There was a problem hiding this comment.
The ursabot never finished
Result e-mails didn't get sent, but the results are here:
https://conbench.arrow-dev.org/runs/1feff919edc146308f1c1a07bbb22a38/
https://conbench.arrow-dev.org/runs/4be675e0f34e40bf8973a9e185e4a60e/
https://conbench.arrow-dev.org/runs/3796a7c7a6864f09b3431230bbf691f2/
https://conbench.arrow-dev.org/runs/15d609bdf13647a0bf858a3c35950a46/
You mean gcc/clang autovectorization didn't manage to vectorize this? Interesting. |
On Godbolt: Interestingly, this fomulation: has the reverse affect on the compilers. |
|
Let ai dig into latest release binary, looks the function is vectorized in internal lib. Microbenchmark refuses to vectorize for some reason. avx2neon |
|
Found it. It is a regression in gcc 16. https://godbolt.org/z/T517add5W That was very confusing. Arrows deb file 25.0.1 was using gcc 14.2 and conbench 15.3. I use gcc 16.2. |
|
In any case, explicit vectorization protects us against such compiler limitations, so worth doing IMHO. |
Agreed. This kind of issue is very annoying. Thanks @domibel for the debug ! |
Rationale for this change
FindMinMaxAvx2 in parquet/level_comparison_avx2.cc was not vectorised.
What changes are included in this PR?
A single xsimd kernel
FindMinMaxSimd<Arch>inlevel_comparison_simd_kernel_internal.h,plus support for multiple architectures.
Are these changes tested?
Yes, with a nice speedup.
Are there any user-facing changes?
No
Was AI used for this PR?
PR code and description written by:
Reviewed before submission by: