Skip to content

Grouped SumV2 kernels for bool and chunked list elements - #10970

Draft
mhk197 wants to merge 1 commit into
mk/list-sum-benchesfrom
mk/grouped-sum-kernels
Draft

mhk197 wants to merge 1 commit into
mk/list-sum-benchesfrom
mk/grouped-sum-kernels

Conversation

@mhk197

@mhk197 mhk197 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

list_sum runs through GroupedAccumulator, which only has a grouped SumV2 kernel for primitive elements. Bool elements fall back to summing one list at a time, and chunked elements are concatenated first. This adds grouped SumV2 kernels for bool and chunked elements. The sparse (#11106) and run-end (#11107) kernels stack on top.

Changes

  • Bool: counts each list's valid set bits with count_range.
  • Chunked: splits each list across the chunks it spans, sums each chunk's parts with that chunk's grouped kernel, and skips chunks no list touches.
  • SumV2GroupPartials (module-private): adds per-part partials with SumV2's overflow and empty rules.

Benchmarks

list_sum benches from the PR below, time vs develop, by average list length.

bench 8 256 4096
bool_sum 0.02× 0.20× 0.21×
chunked_bool_sum 0.05× 0.51× 0.47×
chunked_i32_sum 1.56× 1.58× 0.96×

Testing

  • grouped_kernels_match_per_group_sums: bool, chunked, nested-chunk and overflow cases against a per-list scalar sum_v2.
  • cargo clippy -p vortex-array --all-targets --all-features -- -D warnings, rustfmt (nightly-2026-09-10) and the sum_v2/list_sum tests pass.

Follow-up

  • Short lists over primitive chunks are 1.6× slower: concatenating primitive chunks is cheaper than splitting the lists.

@mhk197 mhk197 added the changelog/performance A performance improvement label Oct 29, 2026
@codspeed

codspeed Bot commented Oct 29, 2026

Copy link
Copy Markdown

Merging this PR will regress 2 benchmarks

2 warnings

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ 2 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚡ 6 improved benchmarks
❌ 2 regressed benchmarks
✅ 2296 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Walltime mul_u64_nonnull_neon 20.3 µs 39.3 µs -48.35%
❌ CPU Simulation random_i8[0.01] 99.2 µs 113.7 µs -12.78%
⚡ CPU Simulation filter_powerlaw_by_random[10000] 421.1 ns 321.7 ns +30.9%
⚡ CPU Simulation filter_powerlaw_by_mostly_true[250000] 200.7 µs 178.7 µs +12.28%
⚡ CPU Simulation filter_powerlaw_by_mostly_true[100000] 78.7 µs 70.3 µs +12.01%
⚡ CPU Simulation max_f64 314.1 µs 281.5 µs +11.59%
⚡ CPU Simulation density_sweep_dense_runs[0.9] 78 µs 69.9 µs +11.5%
⚡ CPU Simulation filter_random_by_mostly_true[250000] 226.2 µs 204.2 µs +10.81%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing mk/grouped-sum-kernels (515fda4) with develop (1d09649)1

Open in CodSpeed

Footnotes

  1. No successful run was found on develop (2eae764) during the generation of this report, so 1d09649 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

Signed-off-by: Matt Katz <mhkatz97@gmail.com>
@mhk197
mhk197 force-pushed the mk/grouped-sum-kernels branch from 515fda4 to 70b11ed Compare November 2, 2026 17:24
@mhk197 mhk197 changed the title Grouped SumV2 kernels for bool, chunked, sparse and run-end list elements Grouped SumV2 kernels for bool and chunked list elements Nov 2, 2026
@mhk197
mhk197 changed the base branch from develop to mk/list-sum-benches November 2, 2026 17:24
@mhk197
mhk197 added this pull request to stack #11108 November 2, 2026 17:24

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/performance A performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant