Repository navigation
Share the mask word walk in vortex-compute and count float statistics a word per chunk - #10362
Conversation
Merging this PR will degrade performance by 10.88%2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
3b55880 to
d9a6538
Compare
|
This PR has been marked as stale because it has been open for 14 days with no activity. Please comment or remove the stale label if you wish to keep it active, otherwise it will be closed in 7 days |
|
This PR was closed because it has been inactive for 7 days since being marked as stale. |
…sk_word Add `for_each_mask_word` and `try_for_each_mask_word` to `vortex-compute`. They walk a `BitBufferView` one `u64` word at a time through `unaligned_chunks`, so the 8-byte aligned body is read with no reshift for each word. Use the walk in these places instead of a local copy: - the masked lane kernels `map_masked_into`, `try_map_masked_into` and `try_map_masked_in_place`, which now accept `impl Into<BitBufferView>` - the filter word walk for a mask bitmap - the primitive and ListView zip kernels - the FoR encoder for chunks with mixed validity, which no longer copies the validity words into a `Vec` Compute the float statistics over chunks of 64 values. A chunk that is fully valid has a branch-free count of its runs, and a mixed chunk gathers its valid values first. The integer statistics are not changed. #10346 rewrote them on develop and that replaces the changes this branch made to them. Signed-off-by: Robert Kruszewski <github@robertk.io>
58c8b83 to
c37e0c5
Compare
…11498) Follow-up to #10362, which added `vortex_compute::lane_kernels::for_each_mask_word`. ## Changes - `vortex-array`: `for_each_transition_word` in `runend/compress.rs` now uses `for_each_mask_word` and `low_bits_mask`. The separate remainder branch is gone. - `vortex-array`: add a `count_bool_runs` benchmark to `run_end_compress`. It counts the runs of a bitmap that starts mid-byte, as a sliced boolean array does. - `vortex-decimal-byte-parts`: `split_wide` now uses `for_each_mask_word` in place of the hand-written 64-value chunk walk. Add the `vortex-compute` dependency. Signed-off-by: Robert Kruszewski <github@robertk.io>
Summary
Several kernels walked a mask one
u64word at a time, and each wrote that walk by hand. This PR moves the fastest version, from the filter kernels, intovortex-computeand uses it in the other kernels. It also makes the float statistics work on chunks of 64 values.Changes
vortex_compute::lane_kernels::mask_words:for_each_mask_word,try_for_each_mask_wordandlow_bits_mask. The walk readsunaligned_chunks, so the 8-byte aligned body is a plain&[u64]and only the first and last word can be short. A private macro writes the body for the first, full and last words, which keeps the full-word length a constant 64. An iterator form nearly doubled the time of the filter SIMD compress.From<&BitBuffer> for BitBufferView: the walk and the masked map kernels (map_masked_into,try_map_masked_into,try_map_masked_in_place) accept either type. Existing&BitBuffercallers do not change.map_masked_intofor the subtraction. It no longer copies the validity words into aVec.Benchmarks
Measured before the rebase onto develop (divan, 4-core cloud container). The statistics rows are medians and the FoR row is the fastest sample:
float_stats_non_nullfloat_stats_nullablefloat_stats_all_non_nullfloat_stats_all_nullablefor_encode/encode_chunked_nullableThe masked maps, the zip kernels,
filter_fixed_widthandfor_encode/encode_chunkedmeasured the same before and after.