You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "pitrou (via GitHub)" <gi...@apache.org> on 2024/01/22 17:21:41 UTC
[PR] GH-39747: [C++][Parquet] Make BYTE_STREAM_SPLIT routines type-agnostic [arrow]
pitrou opened a new pull request, #39748:
URL: https://github.com/apache/arrow/pull/39748
### Rationale for this change
The low-level BYTE_STREAM_SPLIT routines currently reference the logical type they are operating on (float or double). However, the BYTE_STREAM_SPLIT encoding is type-agnostic and only cares about the type width. Removing references to logical types makes these routines easier to reuse.
### Are these changes tested?
Yes, including more exhaustive SIMD tests.
### Are there any user-facing changes?
No. These routines are internal.
<!-- **This PR contains a "Critical Fix".** -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-39747: [C++][Parquet] Make BYTE_STREAM_SPLIT routines type-agnostic [arrow]
Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #39748:
URL: https://github.com/apache/arrow/pull/39748#issuecomment-1906776211
After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 78ec4dc9e823f4283d52f62f9092330e3a9c717b.
There were no benchmark performance regressions. 🎉
The [full Conbench report](https://github.com/apache/arrow/runs/20787328242) has more details.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-39747: [C++][Parquet] Make BYTE_STREAM_SPLIT routines type-agnostic [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39748:
URL: https://github.com/apache/arrow/pull/39748#issuecomment-1904478400
Revision: 267dae43165187e9816633a3ce3686002465b00b
Submitted crossbow builds: [ursacomputing/crossbow @ actions-4c99dc6a39](https://github.com/ursacomputing/crossbow/branches/all?query=actions-4c99dc6a39)
|Task|Status|
|----|------|
|test-alpine-linux-cpp|[](https://github.com/ursacomputing/crossbow/actions/runs/7615038557/job/20738645818)|
|test-build-cpp-fuzz|[](https://github.com/ursacomputing/crossbow/actions/runs/7615038549/job/20738645793)|
|test-conda-cpp|[](https://github.com/ursacomputing/crossbow/actions/runs/7615038620/job/20738646119)|
|test-conda-cpp-valgrind|[](https://github.com/ursacomputing/crossbow/runs/20738647682)|
|test-cuda-cpp|[](https://github.com/ursacomputing/crossbow/actions/runs/7615038333/job/20738644751)|
|test-debian-11-cpp-amd64|[](https://github.com/ursacomputing/crossbow/actions/runs/7615038785/job/20738646957)|
|test-debian-11-cpp-i386|[](https://github.com/ursacomputing/crossbow/actions/runs/7615038543/job/20738645799)|
|test-fedora-38-cpp|[](https://github.com/ursacomputing/crossbow/actions/runs/7615038324/job/20738644725)|
|test-ubuntu-20.04-cpp|[](https://github.com/ursacomputing/crossbow/actions/runs/7615038323/job/20738644768)|
|test-ubuntu-20.04-cpp-bundled|[](https://github.com/ursacomputing/crossbow/actions/runs/7615038415/job/20738645367)|
|test-ubuntu-20.04-cpp-minimal-with-formats|[](https://github.com/ursacomputing/crossbow/actions/runs/7615038553/job/20738645770)|
|test-ubuntu-20.04-cpp-thread-sanitizer|[](https://github.com/ursacomputing/crossbow/actions/runs/7615038360/job/20738644743)|
|test-ubuntu-22.04-cpp|[](https://github.com/ursacomputing/crossbow/actions/runs/7615038721/job/20738646518)|
|test-ubuntu-22.04-cpp-20|[](https://github.com/ursacomputing/crossbow/actions/runs/7615038649/job/20738646117)|
|test-ubuntu-22.04-cpp-no-threading|[](https://github.com/ursacomputing/crossbow/actions/runs/7615038410/job/20738645363)|
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-39747: [C++][Parquet] Make BYTE_STREAM_SPLIT routines type-agnostic [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on PR #39748:
URL: https://github.com/apache/arrow/pull/39748#issuecomment-1904464778
@mapleFU @wgtmac @cyb70289 Does one of you have access to a AVX512 machine? Can you build this PR with `-DARROW_SIMD_LEVEL=AVX512` and run the tests?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-39747: [C++][Parquet] Make BYTE_STREAM_SPLIT routines type-agnostic [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on PR #39748:
URL: https://github.com/apache/arrow/pull/39748#issuecomment-1904533435
> Looks most AVX512 benchmarks are slower than AVX2.
Amusing. Which CPU is it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-39747: [C++][Parquet] Make BYTE_STREAM_SPLIT routines type-agnostic [arrow]
Posted by "cyb70289 (via GitHub)" <gi...@apache.org>.
cyb70289 commented on PR #39748:
URL: https://github.com/apache/arrow/pull/39748#issuecomment-1904528555
All `arrow-utility-test` passed.
```
[----------] 3 tests from TestByteStreamSplitSpecialized/0, where TypeParam = float
[ RUN ] TestByteStreamSplitSpecialized/0.RoundtripSmall
[ OK ] TestByteStreamSplitSpecialized/0.RoundtripSmall (0 ms)
[ RUN ] TestByteStreamSplitSpecialized/0.RoundtripMidsized
[ OK ] TestByteStreamSplitSpecialized/0.RoundtripMidsized (1 ms)
[ RUN ] TestByteStreamSplitSpecialized/0.PiecewiseDecode
[ OK ] TestByteStreamSplitSpecialized/0.PiecewiseDecode (0 ms)
[----------] 3 tests from TestByteStreamSplitSpecialized/0 (1 ms total)
[----------] 3 tests from TestByteStreamSplitSpecialized/1, where TypeParam = double
[ RUN ] TestByteStreamSplitSpecialized/1.RoundtripSmall
[ OK ] TestByteStreamSplitSpecialized/1.RoundtripSmall (0 ms)
[ RUN ] TestByteStreamSplitSpecialized/1.RoundtripMidsized
[ OK ] TestByteStreamSplitSpecialized/1.RoundtripMidsized (0 ms)
[ RUN ] TestByteStreamSplitSpecialized/1.PiecewiseDecode
[ OK ] TestByteStreamSplitSpecialized/1.PiecewiseDecode (0 ms)
[----------] 3 tests from TestByteStreamSplitSpecialized/1 (0 ms total)
```
Looks most AVX512 benchmarks are slower than AVX2.
```
BM_ByteStreamSplitDecode_Float_Sse2/1024 385 ns 385 ns 1817970 bytes_per_second=9.90691G/s
BM_ByteStreamSplitDecode_Float_Sse2/4096 1578 ns 1578 ns 443296 bytes_per_second=9.66871G/s
BM_ByteStreamSplitDecode_Float_Sse2/32768 17828 ns 17828 ns 39266 bytes_per_second=6.84725G/s
BM_ByteStreamSplitDecode_Float_Sse2/65536 36005 ns 36004 ns 19381 bytes_per_second=6.78086G/s
BM_ByteStreamSplitDecode_Double_Sse2/1024 1481 ns 1481 ns 473181 bytes_per_second=5.15284G/s
BM_ByteStreamSplitDecode_Double_Sse2/4096 6152 ns 6152 ns 113963 bytes_per_second=4.96074G/s
BM_ByteStreamSplitDecode_Double_Sse2/32768 50235 ns 50233 ns 10000 bytes_per_second=4.86012G/s
BM_ByteStreamSplitDecode_Double_Sse2/65536 108497 ns 108491 ns 6467 bytes_per_second=4.50067G/s
BM_ByteStreamSplitEncode_Float_Sse2/1024 506 ns 506 ns 1382482 bytes_per_second=7.53754G/s
BM_ByteStreamSplitEncode_Float_Sse2/4096 2092 ns 2092 ns 334971 bytes_per_second=7.29386G/s
BM_ByteStreamSplitEncode_Float_Sse2/32768 21095 ns 21095 ns 32815 bytes_per_second=5.7868G/s
BM_ByteStreamSplitEncode_Float_Sse2/65536 42673 ns 42672 ns 16394 bytes_per_second=5.72127G/s
BM_ByteStreamSplitEncode_Double_Sse2/1024 1504 ns 1504 ns 469782 bytes_per_second=5.07356G/s
BM_ByteStreamSplitEncode_Double_Sse2/4096 6695 ns 6695 ns 104530 bytes_per_second=4.55845G/s
BM_ByteStreamSplitEncode_Double_Sse2/32768 53906 ns 53906 ns 13078 bytes_per_second=4.52898G/s
BM_ByteStreamSplitEncode_Double_Sse2/65536 110635 ns 110631 ns 6351 bytes_per_second=4.41362G/s
BM_ByteStreamSplitDecode_Float_Avx2/1024 245 ns 245 ns 2861683 bytes_per_second=15.5934G/s
BM_ByteStreamSplitDecode_Float_Avx2/4096 1025 ns 1025 ns 681538 bytes_per_second=14.8871G/s
BM_ByteStreamSplitDecode_Float_Avx2/32768 10257 ns 10257 ns 68326 bytes_per_second=11.9015G/s
BM_ByteStreamSplitDecode_Float_Avx2/65536 20694 ns 20694 ns 33842 bytes_per_second=11.7977G/s
BM_ByteStreamSplitDecode_Double_Avx2/1024 1016 ns 1016 ns 688647 bytes_per_second=7.50591G/s
BM_ByteStreamSplitDecode_Double_Avx2/4096 4500 ns 4500 ns 155458 bytes_per_second=6.78202G/s
BM_ByteStreamSplitDecode_Double_Avx2/32768 36439 ns 36438 ns 19211 bytes_per_second=6.70008G/s
BM_ByteStreamSplitDecode_Double_Avx2/65536 78390 ns 78389 ns 8948 bytes_per_second=6.22898G/s
BM_ByteStreamSplitEncode_Float_Avx2/1024 835 ns 835 ns 838644 bytes_per_second=4.57004G/s
BM_ByteStreamSplitEncode_Float_Avx2/4096 3312 ns 3312 ns 211295 bytes_per_second=4.60756G/s
BM_ByteStreamSplitEncode_Float_Avx2/32768 30086 ns 30086 ns 23273 bytes_per_second=4.05734G/s
BM_ByteStreamSplitEncode_Float_Avx2/65536 60202 ns 60201 ns 11628 bytes_per_second=4.05541G/s
BM_ByteStreamSplitEncode_Double_Avx2/1024 1516 ns 1516 ns 462231 bytes_per_second=5.03305G/s
BM_ByteStreamSplitEncode_Double_Avx2/4096 6741 ns 6741 ns 103251 bytes_per_second=4.52713G/s
BM_ByteStreamSplitEncode_Double_Avx2/32768 54044 ns 54043 ns 12981 bytes_per_second=4.51749G/s
BM_ByteStreamSplitEncode_Double_Avx2/65536 111468 ns 111465 ns 6257 bytes_per_second=4.38058G/s
BM_ByteStreamSplitDecode_Float_Avx512/1024 311 ns 311 ns 2253479 bytes_per_second=12.2817G/s
BM_ByteStreamSplitDecode_Float_Avx512/4096 1331 ns 1331 ns 524762 bytes_per_second=11.4655G/s
BM_ByteStreamSplitDecode_Float_Avx512/32768 12203 ns 12203 ns 57141 bytes_per_second=10.0036G/s
BM_ByteStreamSplitDecode_Float_Avx512/65536 24593 ns 24592 ns 28474 bytes_per_second=9.92753G/s
BM_ByteStreamSplitDecode_Double_Avx512/1024 1105 ns 1105 ns 633441 bytes_per_second=6.90407G/s
BM_ByteStreamSplitDecode_Double_Avx512/4096 5196 ns 5196 ns 134568 bytes_per_second=5.8736G/s
BM_ByteStreamSplitDecode_Double_Avx512/32768 42411 ns 42411 ns 16505 bytes_per_second=5.75654G/s
BM_ByteStreamSplitDecode_Double_Avx512/65536 89219 ns 89126 ns 7834 bytes_per_second=5.47857G/s
BM_ByteStreamSplitEncode_Float_Avx512/1024 578 ns 578 ns 1210908 bytes_per_second=6.59961G/s
BM_ByteStreamSplitEncode_Float_Avx512/4096 2495 ns 2495 ns 280623 bytes_per_second=6.11606G/s
BM_ByteStreamSplitEncode_Float_Avx512/32768 28142 ns 28142 ns 24881 bytes_per_second=4.33771G/s
BM_ByteStreamSplitEncode_Float_Avx512/65536 56378 ns 56378 ns 12384 bytes_per_second=4.3304G/s
BM_ByteStreamSplitEncode_Double_Avx512/1024 1034 ns 1034 ns 677564 bytes_per_second=7.38006G/s
BM_ByteStreamSplitEncode_Double_Avx512/4096 7255 ns 7255 ns 96388 bytes_per_second=4.20642G/s
BM_ByteStreamSplitEncode_Double_Avx512/32768 62212 ns 62211 ns 11207 bytes_per_second=3.92438G/s
BM_ByteStreamSplitEncode_Double_Avx512/65536 126019 ns 126013 ns 5535 bytes_per_second=3.87484G/s
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-39747: [C++][Parquet] Make BYTE_STREAM_SPLIT routines type-agnostic [arrow]
Posted by "cyb70289 (via GitHub)" <gi...@apache.org>.
cyb70289 commented on PR #39748:
URL: https://github.com/apache/arrow/pull/39748#issuecomment-1906302920
> Perhaps we should open a separate issue to remove the AVX512 variants then?
Agreed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-39747: [C++][Parquet] Make BYTE_STREAM_SPLIT routines type-agnostic [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on PR #39748:
URL: https://github.com/apache/arrow/pull/39748#issuecomment-1905559108
Perhaps we should open a separate issue to remove the AVX512 variants then?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-39747: [C++][Parquet] Make BYTE_STREAM_SPLIT routines type-agnostic [arrow]
Posted by "cyb70289 (via GitHub)" <gi...@apache.org>.
cyb70289 commented on PR #39748:
URL: https://github.com/apache/arrow/pull/39748#issuecomment-1904736576
> > Looks most AVX512 benchmarks are slower than AVX2.
>
> Amusing. Which CPU is it?
It's Intel Cascade Lake.
https://www.intel.com/content/www/us/en/products/sku/192444/intel-xeon-gold-5218-processor-22m-cache-2-30-ghz/specifications.html
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-39747: [C++][Parquet] Make BYTE_STREAM_SPLIT routines type-agnostic [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on PR #39748:
URL: https://github.com/apache/arrow/pull/39748#issuecomment-1904474226
@github-actions crossbow submit -g cpp
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-39747: [C++][Parquet] Make BYTE_STREAM_SPLIT routines type-agnostic [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou merged PR #39748:
URL: https://github.com/apache/arrow/pull/39748
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-39747: [C++][Parquet] Make BYTE_STREAM_SPLIT routines type-agnostic [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on PR #39748:
URL: https://github.com/apache/arrow/pull/39748#issuecomment-1904765911
This might be because the CPU clock frequency slows down when executing AVX-512 instructions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-39747: [C++][Parquet] Make BYTE_STREAM_SPLIT routines type-agnostic [arrow]
Posted by "cyb70289 (via GitHub)" <gi...@apache.org>.
cyb70289 commented on PR #39748:
URL: https://github.com/apache/arrow/pull/39748#issuecomment-1904961230
Tested with perf, cpu freq (cycles/task-clock) is 2.8GHz for sse2 and avx2 tests, matches the system max frequency.
But for avx512 test, the reported cpu freq is 2.3GHz. IPC also drops.
```
# SSE2, ~2.8GHz
$ sudo perf stat -e cycles,task-clock,instructions -- release/parquet-encoding-benchmark --benchmark_filter="BM_ByteStreamSplitDecode_Float_Sse2/1024"
---------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations UserCounters...
---------------------------------------------------------------------------------------------------
BM_ByteStreamSplitDecode_Float_Sse2/1024 385 ns 385 ns 1818400 bytes_per_second=9.90927G/s
Performance counter stats for 'release/parquet-encoding-benchmark --benchmark_filter=BM_ByteStreamSplitDecode_Float_Sse2/1024':
3,177,983,141 cycles # 2.792 GHz
1,138.11 msec task-clock # 0.967 CPUs utilized
11,062,559,384 instructions # 3.48 insn per cycle
# AVX2, ~2.8GHz
$ sudo perf stat -e cycles,task-clock,instructions -- release/parquet-encoding-benchmark --benchmark_filter="BM_ByteStreamSplitDecode_Float_Avx2/1024"
---------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations UserCounters...
---------------------------------------------------------------------------------------------------
BM_ByteStreamSplitDecode_Float_Avx2/1024 257 ns 257 ns 2725100 bytes_per_second=14.8485G/s
Performance counter stats for 'release/parquet-encoding-benchmark --benchmark_filter=BM_ByteStreamSplitDecode_Float_Avx2/1024':
2,778,881,859 cycles # 2.793 GHz
995.09 msec task-clock # 0.966 CPUs utilized
8,314,230,560 instructions # 2.99 insn per cycle
# AVX512, ~2.3GHz
$ sudo perf stat -e cycles,task-clock,instructions -- release/parquet-encoding-benchmark --benchmark_filter="BM_ByteStreamSplitDecode_Float_Avx512/1024"
-----------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations UserCounters...
-----------------------------------------------------------------------------------------------------
BM_ByteStreamSplitDecode_Float_Avx512/1024 322 ns 322 ns 2173349 bytes_per_second=11.8434G/s
Performance counter stats for 'release/parquet-encoding-benchmark --benchmark_filter=BM_ByteStreamSplitDecode_Float_Avx512/1024':
2,454,008,893 cycles # 2.298 GHz
1,067.73 msec task-clock # 0.965 CPUs utilized
5,877,374,076 instructions # 2.40 insn per cycle
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-39747: [C++][Parquet] Make BYTE_STREAM_SPLIT routines type-agnostic [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39748:
URL: https://github.com/apache/arrow/pull/39748#issuecomment-1904464569
:warning: GitHub issue #39747 **has been automatically assigned in GitHub** to PR creator.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-39747: [C++][Parquet] Make BYTE_STREAM_SPLIT routines type-agnostic [arrow]
Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
wgtmac commented on PR #39748:
URL: https://github.com/apache/arrow/pull/39748#issuecomment-1905156385
> Looks most AVX512 benchmarks are slower than AVX2.
We've seen same performance on Intel Xeon.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-39747: [C++][Parquet] Make BYTE_STREAM_SPLIT routines type-agnostic [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on PR #39748:
URL: https://github.com/apache/arrow/pull/39748#issuecomment-1905560814
@wgtmac @mapleFU Do you want to review this PR?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org