Skip to content

New 1-nn primitive using cutile - #2552

Merged
rapids-bot[bot] merged 19 commits into
NVIDIA:release/26.10from
divyegala:cutile-1nn
Sep 16, 2026
Merged

rapids-bot[bot] merged 19 commits into
NVIDIA:release/26.10from
divyegala:cutile-1nn

Conversation

@divyegala

@divyegala divyegala commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Relies on #2548. This PR also adds the three ways to do a 1-nn behind a new primitive called top_1_nn.

@divyegala
divyegala requested review from a team as code owners September 3, 2026 21:24
@divyegala
divyegala requested a review from jameslamb September 3, 2026 21:24
@divyegala divyegala added feature request New feature or request non-breaking Introduces a non-breaking change labels Sep 3, 2026
@divyegala
divyegala removed the request for review from a team September 4, 2026 01:01
Comment thread cpp/include/cuvs/detail/jit_lto/fused_distance_nn/fused_1nn_fragments.hpp Outdated
Comment thread cpp/src/distance/fused_distance_nn-inl.cuh Outdated
Comment thread cpp/src/distance/fused_distance_nn-inl.cuh Outdated
Comment thread cpp/src/distance/fused_distance_nn-inl.cuh Outdated
Comment thread cpp/src/distance/fused_distance_nn-inl.cuh Outdated
Comment thread cpp/src/distance/fused_distance_nn-inl.cuh Outdated
Comment thread cpp/tests/neighbors/distance_nn.cu
Comment thread cpp/tests/neighbors/distance_nn_helper.cuh Outdated
Comment thread cpp/src/distance/detail/fused_distance_nn/cutile/fused_1nn_tile.hpp Outdated
Comment thread cpp/src/distance/detail/fused_distance_nn/cutile/fused_1nn_tile.hpp Outdated
Comment thread cpp/CMakeLists.txt Outdated
Comment thread cpp/src/distance/fused_distance_nn-inl.cuh Outdated
Comment thread cpp/src/distance/fused_distance_nn-inl.cuh Outdated
Comment thread cpp/src/distance/fused_distance_nn-inl.cuh Outdated
Comment thread cpp/src/distance/detail/fused_distance_nn/cutile/fused_1nn_tile.cu Outdated
Comment thread cpp/src/distance/fused_distance_nn-inl.cuh Outdated
Comment thread cpp/tests/neighbors/distance_nn.cu Outdated
Unfortunately, when NVIDIA#2547 was merged, the docs had already managed to drift from the code. This commit catches them up.
@divyegala
divyegala changed the base branch from main to release/26.10 September 8, 2026 20:13
@divyegala
divyegala requested a review from a team as a code owner September 8, 2026 20:13
@divyegala
divyegala requested a review from a team as a code owner September 8, 2026 20:47
@divyegala
divyegala removed request for a team September 8, 2026 22:46
Comment thread cpp/cmake/modules/generate_cutile_tile_metadata.py Outdated

@tfeher tfeher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Divye for the PR! Looks good overall, I have only minor comments.

Comment thread cpp/src/distance/detail/fused_distance_nn/cutile/fused_1nn_tile.cu Outdated
Comment thread cpp/src/distance/detail/fused_distance_nn/cutile/fused_1nn_tile.hpp Outdated
Comment thread cpp/src/distance/fused_distance_nn-inl.cuh Outdated

@KyleFromNVIDIA KyleFromNVIDIA left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one small request. I don't need to approve again.

Comment thread cpp/cmake/modules/cutile_tile_metadata.hpp.in Outdated
Comment thread cpp/cmake/modules/cutile_tile_metadata.hpp.in Outdated

@tfeher tfeher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@huuanhhuyn huuanhhuyn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dantegd dantegd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small comments

Comment thread cpp/src/distance/fused_distance_nn-inl.cuh
Comment thread cpp/src/distance/fused_distance_nn-inl.cuh Outdated
Comment thread cpp/src/distance/detail/fused_distance_nn/cutile/fused_1nn_kernel.py Outdated

@dantegd dantegd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last comment and one question:

The cutile zero norm handling looks good. One possible follow-up: the existing Cutlass/SIMT cosine operators still produce non-finite values for zero norms, no? While cuTile and Unfused now return distance 1. Since that behavior predates this PR, I don’t think it needs to block this change, but would it be worth tracking backend consistency separately?

Comment thread cpp/tests/neighbors/distance_nn.cu
@divyegala

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit 6063a37 into NVIDIA:release/26.10 Sep 16, 2026
193 of 197 checks passed
zbrad added a commit to zbrad/cuvs that referenced this pull request Sep 18, 2026
GTEST_SKIP() inside compute_1nn() only returns from that helper, so the
TEST_P body went on to compare() against outputs that were never written and
reported spurious failures. On GB10 with driver 580.173.02 cuTile kernel
launch is unavailable, so all 12 cuTile-backend NNTest cases (fp32_fused
16-24, fp16_fused 0-1, fp32_fused_i64 0) failed; with the guard they are
reported as skipped (42 passed, 12 skipped, 0 failed).

Guard in compare() via Test::IsSkipped(). Upstream test from NVIDIA#2552.

Assisted-by: Claude
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants