Repository navigation
Conversation
Select among the fallback kernel, WarpReduce, and BlockReduce based on the contiguous reduction-axis size. Keep the BlockLoad fast path when BlockReduce handles an identity pre-map. Also use CUB's fixed-size int API for device segmented reduce on CUDA when segment_size fits in int, avoiding offset-iterator workspace.
Contributor
|
This pull request is now in conflicts. Could you fix it @seberg? 🙏 |
Member
Author
|
Closing this for now as the big issue is solved (with cub segmented reduce using fixed-width path and naive fallback for others). Since it would be nice to use cuda-compute soon where this should drop out much cleaner/simpler. |
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.
This is mostly vie coded, and I'll include a fully vibe coded benchmark script in the details below.
I'll open another PR that just focuses on not using the generic CUB paths for very short reductions (maybe mostly for the simplicity).
For intermediate sizes 1028-4096 (very rough), there are places where a WrapReduce should get 2x speedup.
(The main reason why I will do the other PR first is that (a) if we go here I should review it a bit more myself but mainly (b) I am wondering about using different approaches for the whole thing and the minimal thing is at least enough to not be a gigantic performance issue)
Details