Repository navigation
Add Super K-Means #2948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sherylll
wants to merge
47
commits into
NVIDIA:release/26.12
Choose a base branch
from
sherylll:superkmeans
base: release/26.12
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add Super K-Means #2948
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
8b35602
Add SuperKMeans k-means API with an unpruned fallback
sherylll e83a28f
Add SuperKMeans' fused first-filter cuTile kernel
sherylll 19b3fb4
Add SuperKMeans' pruned assignment
sherylll 443bb05
Order SuperKMeans' pruning by survivor count (LPT)
sherylll 669fcc1
Run SuperKMeans' row batches on the handle's stream pool
sherylll 844f2f0
Move SuperKMeans' pruned assignment into a pruned 1-NN distance
sherylll 4bf9ccc
Prune survivor lists in place, out of shared memory
sherylll 18779b1
Write one contiguous first-filter survivor list per row
sherylll e58ee5c
Prune only with dims past the first filter's; simplify the kernel
sherylll 1edbba5
Return early from pruning rows with no survivors
sherylll 75ea3ab
Overlap row batches on the main stream and one pool stream
sherylll fca97b1
Fix style: SuperKMeans API reference, formatting, copyright
sherylll 2d869df
Compute the filter's norms from its FP16 values, with the FP16 copy
sherylll 6a2ae57
Compute the pruning ratios from eps0 in the kernel, not from a device…
sherylll a57a157
Assign in full for half rows the filter can't read in place; document…
sherylll e7cb068
Load the pruning kernel's tiles in 16-byte loads; drop its launch bounds
sherylll 0ee37a6
Add license
sherylll e02f9db
Replace custom warp reduce with cub::WarpReduceBatched
sherylll 31b9674
Merge branch 'main' into superkmeans
sherylll 6b3a662
Hardcode eps0
sherylll f2355d4
Halve pruned 1-NN centroid batch to 1024
sherylll 9565eb9
Merge branch 'main' into superkmeans
sherylll 4760f3b
Merge branch 'main' into superkmeans
sherylll 79bdbba
Prepare SuperKMeans filter rows per batch
sherylll b3e9476
Require supported layouts for high-dimensional SuperKMeans pruning
sherylll a71429f
Size SuperKMeans row batches from workspace budget
sherylll 3b2571b
Tune tile sizes for different arch (coarsely)
sherylll 4c2585a
Fix style
sherylll 26372e2
Add sm103 for completeness; update tile sizes based on measurements on
sherylll 0bbf70c
Merge upstream/main into superkmeans
sherylll 78d844a
Remove duplicate kmeans_type definition
sherylll 5a45435
Small refactor
sherylll 976b372
More refactoring: in F32 mode, use F32 data to calculate norm, even t…
sherylll f92bdc4
Use raft launch_kernel
sherylll 6f9fb0a
Peel single-survivor tail from pruned nearest-neighbor search
sherylll 91ee26a
Order pruning rows from each fused-filter tile
sherylll 7054a3f
Small cleanup
sherylll 3e2964b
Merge branch 'release/26.12' into superkmeans
sherylll e3a2550
Mark SuperKMeans API experimental
sherylll 0a70f8c
Use RAFT warp primitives in pruned assignment
sherylll 572253e
Support partial dimension tiles in pruned assignment
sherylll d2713a5
Remove redundant initial survivor check in prune
sherylll 7fa7a8b
Merge branch 'release/26.12' into superkmeans
sherylll 8cb98b7
Simplify prune survivor arguments and use RAFT warp helpers
sherylll 29970b1
Use workspace memory and dry-run sizing in SuperKMeans
sherylll 82ac907
Add NVTX ranges for pruned 1-NN filter and pruning
sherylll 20e5fbb
Use dry-run execution and round up SuperKMeans batches
sherylll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Order pruning rows from each fused-filter tile
- Loading branch information
commit 91ee26aad294d198feac94c5c708aa504bfb0fca
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I remember our previous discussion, the survivors distribution may be very long-tailed, so the kernel becomes very unbalanced if we process one block per whole list.
Could you try to refactor the kernel and its launch grid to make the work balanced? One idea that we sounded earlier:
0) Run a cumulative sum pass over number of survivors per vector to get the total number of survivors and the O(1) mapping from global survivor index to (query id, local survivor id)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach could save the runtime survivor list compaction, which can be deferred to a standalone reduction kernel. But there are still some caveats: