You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Performance
Batch sizing for candidate datasets larger than the device’s L2 cache now adapts to the selected kernel’s occupancy and device capacity. Datasets that fit in L2 retain the maximum batch size. This behavior is applied separately to each kernel launch, while batched processing and 64-bit index handling remain unchanged.
The fused 1-NN tile launcher now selects a row batch for each ABI launch. It uses the maximum batch when candidate data fits in L2 cache and an occupancy-based batch otherwise. Each ABI launch processes all batches and widens int64 indices as needed.
The code calculates a two-wave batch from kernel occupancy, using active-cluster occupancy for clustered kernels and active-block occupancy across the device otherwise. For candidate data larger than L2 cache, the launcher uses this batch, capped at the maximum. For data that fits in L2 cache, it uses the maximum batch. Each ABI launch processes its batches and widens int64 indices.
The change sizes fused 1-NN row batches from kernel occupancy when candidate data exceeds L2. No correctness or safety defect was found, and a mistaken occupancy estimate would only affect performance. Add the missing category and breaking labels so the label check passes. Benchmarking on target GPUs would confirm the intended full-wave behaviour.
Security architecture risk: Minimal · up to d9c87
The change adjusts how much GPU work is processed per batch while preserving existing input checks and output limits. No introduced or worsened risk to security, isolation, or failure containment was established.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: selecting the 1-NN row batch size from GPU occupancy (SM count and CTAs per SM) to get full waves per launch. The raw summary confirms the batch size is now derived fr…
Description check
The description states the goal of selecting an optimal row batch from SM count and CTAs per SM so each batch launch has full waves. This matches the changeset, which derives batch sizes from occupanc…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: selecting the 1-NN row batch size from GPU occupancy (SM count and CTAs per SM) to get full waves per launch. The raw summary confirms the batch size is now derived from kernel occupancy in fused_1nn_tile.cu. The '[Experimental]' prefix and the 'Tail Effect / Wave Quantization' label are extra context but do not make the title unrelated. The title is 68 characters, within a reasonable length.
Full details: Description check
Explanation
The description states the goal of selecting an optimal row batch from SM count and CTAs per SM so each batch launch has full waves. This matches the changeset, which derives batch sizes from occupancy in fused_1nn_tile.cu. Most of the description is the unedited contribution template, but the opening paragraph is related to the changes.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.
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
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.
Try if we can select optimal row batch across GPUs based on number of SMs and number of CTAs per SM. Goal is to have full waves per batch launch.