Spread each segment of the segmented bitmask reduction across several blocks - #23686
Draft
vuule wants to merge 2 commits into
Draft
Spread each segment of the segmented bitmask reduction across several blocks#23686vuule wants to merge 2 commits into
vuule wants to merge 2 commits into
Conversation
…blocks The kernel gave each segment a single warp, so the whole null mask of a column was walked by 32 threads: reducing 192 masks of 500k rows was only 6144 threads for 3M words and ran at roughly a tenth of achievable bandwidth. Blocks now cooperate on a segment when there are few of them, with the per-segment null count accumulated across the blocks. The existing benchmark axes only cover masks of up to 128 bits, which fit in a handful of words and cannot show this, so add a case with mask sizes in the range of real table row counts.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
segmented_offset_bitmask_binopassigned one warp to each segment, so a segment's entire null mask was walked by 32 threads regardless of how long it is. For the struct null mask reduction this kernel exists to serve, a segment is one column's mask and its length is the table's row count, so reducing 192 masks of 500k rows ran on 6144 threads and reached roughly a tenth of achievable bandwidth. Blocks now cooperate on a segment when there are few segments, with each segment's null count accumulated across its blocks.The existing
parquet_read_fixed_width_structis 5.2% to 6.2% faster end to end on an A100 80GB, a flat ~0.62 ms in all four configurations: the Parquet reader callsenforce_null_consistencyon every struct hierarchy it produces, and that is this kernel. The existingparquet_read_decode -a data_type=STRUCTshows the same ~0.3 ms absolute saving, worth 1.4% to 2.4% there since string decode dominates that profile.In isolation,
segmented_bitmask_andon 8 to 512 segments of 100k to 1M bits is 23% to 98% faster. The existing bitmask axes stop at 128-bit masks, which fit in a handful of words and cannot show this, so a case with mask sizes in the range of real table row counts is added; those existing narrow configurations are unchanged within noise.Independent of #23484, which removes the mask allocations on the same path. The two compose: 23484 calls
inplace_segmented_bitmask_binopdirectly instead ofsegmented_bitmask_and, which is the same entry point reparallelized here and dispatches to the same kernel.Checklist