Skip to content

New 1-nn primitive using cutile - #2552

Open
divyegala wants to merge 8 commits into
NVIDIA:release/26.10from
divyegala:cutile-1nn
Open

New 1-nn primitive using cutile#2552
divyegala wants to merge 8 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
Comment thread cpp/src/distance/fused_distance_nn-inl.cuh Outdated
Comment thread cpp/tests/neighbors/distance_nn.cu
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 on lines +39 to +40
if (lhs_bytes > std::numeric_limits<std::uintptr_t>::max() - lhs_begin ||
rhs_bytes > std::numeric_limits<std::uintptr_t>::max() - rhs_begin) {

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.

Is this just a theoretical possibility, or do we really have a system where this condition can actually be true?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is only theoretical, the main motivation was to check for aliasing of sub-views. I reworked it.

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
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.

5 participants