Skip to content
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

[REVIEW] Fix brute force KNN distance metric issue #3755

Merged
merged 1 commit into from
Apr 16, 2021

Conversation

viclafargue
Copy link
Contributor

@viclafargue viclafargue commented Apr 16, 2021

The brute force KNN default distance metric switched from L2SqrtExpanded (or equivalent with FAISS metrics) to L2Unexpanded recently. I believe that it was a voluntary move to speedup calculations. However some calls to the raft::spatial::knn::brute_force_knn function in the cuML codebase required specifying a non-default metric. This is the case of distances that are not kept internally by an estimator but are instead provided to the end-user as results. This is also the case of features that specify a specific distance metric for their calculations. Please tell if you notice some other places where a non-default distance metric should have been specified.

cc @MatthiasKohl

@viclafargue viclafargue requested a review from a team as a code owner April 16, 2021 13:20
@viclafargue viclafargue changed the title [REVIEW] Fix metric issue with brute force KNN [REVIEW] Fix brute force KNN distance metric issue Apr 16, 2021
@viclafargue viclafargue added 3 - Ready for Review Ready for review by team bug Something isn't working non-breaking Non-breaking change labels Apr 16, 2021
@MatthiasKohl
Copy link

Concerning MNMG KNN, the change looks good.
I can see that tsne and umap (as well as the tests for umap) also use this raft::spatial::knn::brute_force_knn primitive. I'm not sure whether for those algos the metric matters, but maybe someone should double-check?

@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (branch-0.20@ef78253). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff               @@
##             branch-0.20    #3755   +/-   ##
==============================================
  Coverage               ?   85.96%           
==============================================
  Files                  ?      225           
  Lines                  ?    16986           
  Branches               ?        0           
==============================================
  Hits                   ?    14602           
  Misses                 ?     2384           
  Partials               ?        0           
Flag Coverage Δ
dask 48.96% <0.00%> (?)
non-dask 77.80% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef78253...afdc477. Read the comment docs.

@viclafargue
Copy link
Contributor Author

@cjnolet and @lowener would be nice if you could take a quick look at this PR. Do you know if I forgot any necessary modifications here?

@JohnZed JohnZed changed the base branch from branch-0.20 to branch-0.19 April 16, 2021 17:06
Copy link
Contributor

@lowener lowener left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@divyegala divyegala left a comment

Choose a reason for hiding this comment

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

LGTM

@ajschmidt8 ajschmidt8 merged commit b4ed0ad into rapidsai:branch-0.19 Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team bug Something isn't working non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants