8000 [FIX] Revert negated InnerProduct distance for NN Descent by jinsolp · Pull Request #859 · rapidsai/cuvs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[FIX] Revert negated InnerProduct distance for NN Descent #859

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

Merged
merged 6 commits into from
May 7, 2025

Conversation

jinsolp
Copy link
Contributor
@jinsolp jinsolp commented Apr 29, 2025

Closing #849

Many parts of NN Descent is written on top of the assumption that smaller distance is closer.
Therefore, using the current trick (using -(dot product) values) to make it consistent with other metrics to be sorted in ascending order, then negating the value at the end should be the neatest solution.

@jinsolp jinsolp self-assigned this Apr 29, 2025
@jinsolp jinsolp requested a review from a team as a code owner April 29, 2025 23:10
Copy link
copy-pr-bot bot commented Apr 29, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions bot added the cpp label Apr 29, 2025
@jinsolp jinsolp added bug Something isn't working non-breaking Introduces a non-breaking change labels Apr 29, 2025
@jinsolp
Copy link
Contributor Author
jinsolp commented Apr 29, 2025

/ok to test

Copy link
copy-pr-bot bot commented Apr 29, 2025

/ok to test

@jinsolp, there was an error processing your request: E1

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/

@jinsolp
Copy link
Contributor Author
jinsolp commented Apr 29, 2025

/ok to test a602546

if (build_config_.metric == cuvs::distance::DistanceType::L2SqrtExpanded) {
raft::linalg::map(
res, output_dist_view, raft::sqrt_op{}, raft::make_const_mdspan(output_dist_view));
} else if (build_config_.metric == cuvs::distance::DistanceType::InnerProduct) {
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: Can we use the is_min_close function here instead of checking for IP distance itself?

Suggested change
} else if (build_config_.metric == cuvs::distance::DistanceType::InnerProduct) {
} else if (!cuvs::distance::is_min_close(build_config_.metric)) {

Copy link
Member

Choose a reason for hiding this comment

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

+1

@jinsolp
Copy link
Contributor Author
jinsolp commented May 6, 2025

/ok to test 5e68d85

@jinsolp
Copy link
Contributor Author
jinsolp commented May 7, 2025

/ok to test d23835a

@jinsolp
Copy link
Contributor Author
jinsolp commented May 7, 2025

/ok to test 5891601

@cjnolet
8000
Copy link
Member
cjnolet commented May 7, 2025

/merge

@rapids-bot rapids-bot bot merged commit 05494cb into rapidsai:branch-25.06 May 7, 2025
74 checks passed
@jinsolp jinsolp deleted the fix-nnd-innerproduct branch May 7, 2025 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cpp non-breaking Introduces a non-breaking change
Development

Successfully merging this pull request may close these issues.

3 participants
0