Make GPU scans process multiple items per thread - #108
Merged
Conversation
shreyas-omkar
force-pushed
the
sh/accumulate-raking
branch
from
August 11, 2026 14:21
55665f3 to
44c814d
Compare
Member
Author
Cross-backend, Float32
|
shreyas-omkar
force-pushed
the
sh/accumulate-raking
branch
from
August 18, 2026 14:33
e420f05 to
e4c354d
Compare
maleadt
force-pushed
the
sh/accumulate-raking
branch
from
August 19, 2026 13:44
e4c354d to
f4e36c6
Compare
Scan block_size*items_per_thread elements by combining per-thread runs with a block-wide scan. Keep the default within the 32 KiB shared-memory baseline for wide element types. For multi-block exclusive decoupled lookback, save tile boundaries in per-block scratch and shift each tile in place after carry propagation.
Cover nonuniform exclusive scans for both algorithms, non-power-of-two item counts, wide element types, and oversized scratch arrays.
maleadt
force-pushed
the
sh/accumulate-raking
branch
from
August 20, 2026 17:37
5f2f07f to
c2cd74f
Compare
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.
GPU scans currently process two items per thread. This PR makes that configurable with an
items_per_threadkeyword and uses eight by default where the element type fits within the 32 KiB shared-memory baseline. The value does not need to be a power of two.Each thread scans a blocked run after a coalesced load, then the block scans the per-thread totals. On an RTX 5080 with 64M
Int32elements, this reducedScanPrefixesfrom 2.00 ms to 1.31 ms andDecoupledLookbackfrom 10.4 ms to 3.8 ms.This also fixes multi-block exclusive
DecoupledLookbackscans. After inclusive carry propagation, two epilogue kernels save one boundary value per tile and shift each tile in place; no full-array temporary is allocated.ScanPrefixesremains the default.Validated with the CUDA and OpenCL accumulate test suites.