Repository navigation
perf(cuda): speed up bit-unpacking in dyn dispatch - #11629
Merged
Merged
Conversation
The dynamic dispatch kernel runs 64-thread blocks, but it assigned one thread per FastLanes lane when unpacking a 1024-element chunk. 32- and 64-bit chunks have only 32 and 16 lanes, so half or three quarters of the block waited at the barrier while the rest unpacked. Split 32- and 64-bit lanes into 16-row slices so that every thread decodes one slice, and distribute (chunk, slice, lane) work across the block, which also parallelizes multi-chunk input stages such as dictionary values. The generator now emits the per-row decode code once, as slices, and builds the whole-lane decoders used by the standalone kernels from them. Fused u32 and u64 kernels in the dynamic_dispatch_cuda benchmarks are 11-19% faster, e.g. ALP(FoR(BitPacked)) f64 369 -> 299 us at 100M elements. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
0ax1
enabled auto-merge (squash)
November 19, 2026 12:48
robert3005
approved these changes
Nov 19, 2026
Contributor
|
I trust that the math checks out |
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.
The dynamic dispatch kernel unpacks each 1024-element FastLanes chunk with one thread per lane, but 32- and 64-bit chunks have only 32 and 16 lanes, so half or three quarters of each 64-thread block waited at the barrier during the unpack. This splits those lanes into 16-row slices so every thread decodes one, and spreads the work over all chunks of a stage. The generator emits the per-row decode code once, as slices, and builds the whole-lane decoders used by the standalone kernels from them.
Fused u32 and u64 kernels in
dynamic_dispatch_cudaare 11–19% faster, e.g.alp_for_bp_6bw_f64at 100M elements goes from 369 µs to 299 µs.