Repository navigation
perf(coalesce): copy sparse byte-array indices directly - #12223
Rich-T-kid wants to merge 1 commit into
Conversation
|
run benchmark coalesce_kernels |
|
🤖 Benchmark starting (GKE) | trigger Target: coalesce_kernels Sharding factor: 1 (1 workers). Comparing rich-T-kid/coalesce-string-indices (618a419) to 4e04fea (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: coalesce_kernels Comparing rich-T-kid/coalesce-string-indices (618a419) to 4e04fea (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
shards: 1
DetailsPer-runner informationcoalesce_kernels — shard 1/1Node: gk3-benchmark-cluster-nap-lxiegy2m-b02d82b1-lsf8 Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench coalesce_kernelsCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
618a419 to
7701041
Compare
|
run benchmark coalesce_kernels |
|
🤖 Benchmark starting (GKE) | trigger Target: coalesce_kernels Sharding factor: 1 (1 workers). Comparing rich-T-kid/coalesce-string-indices (7701041) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: coalesce_kernels Comparing rich-T-kid/coalesce-string-indices (7701041) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
shards: 1
DetailsPer-runner informationcoalesce_kernels — shard 1/1Node: gk3-benchmark-cluster-nap-hysmgqbk-8c5f483c-f2kp Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench coalesce_kernelsCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
7701041 to
6adfdee
Compare
|
run benchmark coalesce_kernels |
|
🤖 Benchmark starting (GKE) | trigger Target: coalesce_kernels Sharding factor: 1 (1 workers). Comparing rich-T-kid/coalesce-string-indices (6adfdee) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: coalesce_kernels Comparing rich-T-kid/coalesce-string-indices (6adfdee) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
shards: 1
DetailsPer-runner informationcoalesce_kernels — shard 1/1Node: gk3-benchmark-cluster-nap-12rv6o5a-dad8edb0-l6rk Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench coalesce_kernelsCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
run benchmark coalesce_kernels |
|
run benchmark coalesce_kernels |
|
show benchmark queue |
|
Hi @Rich-T-kid, you asked to view the benchmark queue (#12223 (comment)).
File an issue against this benchmark runner |
|
🤖 Benchmark starting (GKE) | trigger Target: coalesce_kernels Sharding factor: 1 (1 workers). Comparing rich-T-kid/coalesce-string-indices (b283975) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
resources:
arch: arm64
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
🤖 Benchmark starting (GKE) | trigger Target: coalesce_kernels Sharding factor: 1 (1 workers). Comparing rich-T-kid/coalesce-string-indices (b283975) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
resources:
arch: amd64
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: coalesce_kernels Comparing rich-T-kid/coalesce-string-indices (b283975) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
resources:
arch: amd64
shards: 1
DetailsPer-runner informationcoalesce_kernels — shard 1/1Node: gk3-benchmark-cluster-nap-e10s86d6-7faabcec-pbjl Instance: c4-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench coalesce_kernelsCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: coalesce_kernels Comparing rich-T-kid/coalesce-string-indices (b283975) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
resources:
arch: arm64
shards: 1
DetailsPer-runner informationcoalesce_kernels — shard 1/1Node: gk3-benchmark-cluster-nap-ez8gwx9u-593cc0f5-jvvf Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench coalesce_kernelsCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
b283975 to
510230c
Compare
|
run benchmark coalesce_kernels |
|
run benchmark coalesce_kernels |
|
🤖 Benchmark starting (GKE) | trigger Target: coalesce_kernels Sharding factor: 1 (1 workers). Comparing rich-T-kid/coalesce-string-indices (510230c) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: '^take: (single_utf8|single_binary|mixed_utf8), 8192, nulls: (0|0\.1), selectivity: (0\.001|0\.01|0\.1|0\.8)$'
resources:
arch: amd64
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
🤖 Benchmark starting (GKE) | trigger Target: coalesce_kernels Sharding factor: 1 (1 workers). Comparing rich-T-kid/coalesce-string-indices (510230c) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: '^take: (single_utf8|single_binary|mixed_utf8), 8192, nulls: (0|0\.1), selectivity: (0\.001|0\.01|0\.1|0\.8)$'
resources:
arch: arm64
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: coalesce_kernels Comparing rich-T-kid/coalesce-string-indices (510230c) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: '^take: (single_utf8|single_binary|mixed_utf8), 8192, nulls: (0|0\.1), selectivity: (0\.001|0\.01|0\.1|0\.8)$'
resources:
arch: amd64
shards: 1
DetailsPer-runner informationcoalesce_kernels — shard 1/1Node: gk3-benchmark-cluster-nap-2qaq7be7-fd2ba571-v2rh Instance: c4-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench coalesce_kernelsCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: coalesce_kernels Comparing rich-T-kid/coalesce-string-indices (510230c) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: '^take: (single_utf8|single_binary|mixed_utf8), 8192, nulls: (0|0\.1), selectivity: (0\.001|0\.01|0\.1|0\.8)$'
resources:
arch: arm64
shards: 1
DetailsPer-runner informationcoalesce_kernels — shard 1/1Node: gk3-benchmark-cluster-nap-1ftdidtx-5aca7468-7zn4 Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench coalesce_kernelsCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
510230c to
3245ba5
Compare
|
run benchmark coalesce_kernels |
|
🤖 Benchmark starting (GKE) | trigger Target: coalesce_kernels Sharding factor: 1 (1 workers). Comparing rich-T-kid/coalesce-string-indices (8d0d96a) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
resources:
arch: arm64
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
🤖 Benchmark starting (GKE) | trigger Target: coalesce_kernels Sharding factor: 1 (1 workers). Comparing rich-T-kid/coalesce-string-indices (8d0d96a) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
resources:
arch: amd64
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: coalesce_kernels Comparing rich-T-kid/coalesce-string-indices (8d0d96a) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
resources:
arch: amd64
shards: 1
DetailsPer-runner informationcoalesce_kernels — shard 1/1Node: gk3-benchmark-cluster-nap-1e3im07h-baf3dd5e-ptd2 Instance: c4-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench coalesce_kernelsCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: coalesce_kernels Comparing rich-T-kid/coalesce-string-indices (8d0d96a) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
resources:
arch: arm64
shards: 1
DetailsPer-runner informationcoalesce_kernels — shard 1/1Node: gk3-benchmark-cluster-nap-q1db7b2y-b3409901-thj6 Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench coalesce_kernelsCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
run benchmark coalesce_kernels |
|
🤖 Benchmark starting (GKE) | trigger Target: coalesce_kernels Sharding factor: 1 (1 workers). Comparing rich-T-kid/coalesce-string-indices (8d0d96a) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
resources:
arch: arm64
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
run benchmark coalesce_kernels |
|
🤖 Benchmark starting (GKE) | trigger Target: coalesce_kernels Sharding factor: 1 (1 workers). Comparing rich-T-kid/coalesce-string-indices (8d0d96a) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
resources:
arch: amd64
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
run benchmark coalesce_kernels |
|
🤖 Benchmark starting (GKE) | trigger Target: coalesce_kernels Sharding factor: 1 (1 workers). Comparing rich-T-kid/coalesce-string-indices (8d0d96a) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
id like to attribute the minor regression to noise but lets see 😅 |
|
🤖 Benchmark completed (GKE) | trigger Target: coalesce_kernels Comparing rich-T-kid/coalesce-string-indices (8d0d96a) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
resources:
arch: amd64
shards: 1
DetailsPer-runner informationcoalesce_kernels — shard 1/1Node: gk3-benchmark-cluster-nap-1e3im07h-ade29973-sqkt Instance: c4-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench coalesce_kernelsCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: coalesce_kernels Comparing rich-T-kid/coalesce-string-indices (8d0d96a) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
shards: 1
DetailsPer-runner informationcoalesce_kernels — shard 1/1Node: gk3-benchmark-cluster-nap-q1db7b2y-cf67b4a9-pqnh Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench coalesce_kernelsCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: coalesce_kernels Comparing rich-T-kid/coalesce-string-indices (8d0d96a) to 4ea4d22 (merge-base) diff Run configurationrun benchmark coalesce_kernels
env:
BENCH_FILTER: 'take: (single_utf8|mixed_utf8|single_binary),'
resources:
arch: arm64
shards: 1
DetailsPer-runner informationcoalesce_kernels — shard 1/1Node: gk3-benchmark-cluster-nap-q1db7b2y-cf67b4a9-hfwx Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench coalesce_kernelsCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
turns out it was noise |
alamb
left a comment
There was a problem hiding this comment.
Thanks for this @Rich-T-kid
I am a little worried that some of this code could be being overfit to the benchmarks. I wonder if we have any sense of how much is general purpose or if there is any way to reuse these pattens somehow
8d0d96a to
d0d97f3
Compare
@alamb I'm not sure what you mean by this. If you mean the common pattern of taking data from a source array and appending it to an output array, I agree. While working on the coalescer kernel, I noticed it would be a great fit if the take kernel accepted a src and dst instead of always creating its own buffers/arrays. It's somewhat similar to #6430, which I've had my eye on for a while, but I haven't found a tangible use case in DataFusion that I could point to that would make it clearly useful. besides that ive addressed your review comments 🙇 |
Sorry -- I should have been more clear. What I was was worried about was if the patterns in this PR are very specific / only work well for the distribution of values that are found in the benchmarks, rather than being broadly applicable. That being said on second look I think it looks better
Yes, in my mind that was in fact the key rationale for Thank you for pushing it along |
ah I see what you mean. yea this is challenging since the exact cutoff variess between arch/machines. but I agree this isnt ideal to have seemingly random cutoff constants in the code base marking this as a draft since its based on #12399 |
# Which issue does this PR close? - Relates to apache#12223. # Rationale for this change Keep indexed-copy capabilities with their implementations, as suggested in [this review comment](https://github.com/apache/arrow-rs/pull/12223/changes#r4656794087). # What changes are included in this PR? Adds `supports_dense_indexed_copy` to `InProgressArray`, with `true` for implementations that specialize `copy_rows_by_indices`. # Are these changes tested? A table-driven unit test covers each in-progress array implementation. # Are there any significant user-facing changes? No.
d0d97f3 to
d90e331
Compare
|
rebased on main, ready for another review 🙇 |
Which issue does this PR close?
Rationale for this change
Indexed byte-array copies currently materialize an intermediate array with
takeand then copy the selected values again into the coalescer. This is especially expensive for sparse selections.What changes are included in this PR?
Sparse
Utf8,LargeUtf8,Binary, andLargeBinaryselections are copied directly into the coalescer. Denser selections use the existingtakeimplementation and adopt its buffers when every schema column is primitive or a variable-width byte array. Other schemas keep the existing coalescing path. Thetakekernel itself is unchanged.I used Codex to help implement the change and run the benchmark matrix. I reviewed the final code and benchmark results.
Are these changes tested?
Tests cover direct copying and fallback behavior, including nulls, slices, repeated and out-of-order indices, and target-batch splitting.
The matrix spans single UTF-8, single binary, and mixed primitive/UTF-8 schemas; nullable and non-null data; and 0.1%, 1%, 10%, and 80% selectivity.
Are there any significant user-facing changes?
No.