Skip to content

Grouped SumV2 kernel for sparse list elements - #11106

Draft
mhk197 wants to merge 1 commit into
mk/grouped-sum-kernelsfrom
mk/grouped-sum-sparse
Draft

mhk197 wants to merge 1 commit into
mk/grouped-sum-kernelsfrom
mk/grouped-sum-sparse

Conversation

@mhk197

@mhk197 mhk197 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a grouped SumV2 kernel for sparse elements. Each list sums its patches as a group of the patch values, plus the fill times its uncovered elements, instead of decoding the sparse array. statpopgen's GT comparisons produce sparse bools.

Changes

  • SparseGroupedSumV2Kernel in vortex-sparse, registered by initialize.
  • SumV2GroupPartials becomes public and gains add_repeated for the fill.
  • Decimal sums still fall back.

Benchmarks

Time vs the PR below, by average list length.

bench 8 256 4096
sparse_bool_sum 1.96× 0.69× 0.14×
chunked_sparse_bool_sum 1.41× 1.01× 0.24×

Testing

  • grouped_sum_matches_decoded: 5 sparse cases against summing the decoded array.
  • cargo clippy -p vortex-array -p vortex-sparse --all-targets --all-features -- -D warnings and the vortex-sparse sum tests pass.

Follow-up

  • Lists of 8 are slower than decoding and counting bits; the kernel could decline short lists.

Signed-off-by: Matt Katz <mhkatz97@gmail.com>

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