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

Update and standardize IVF indexes API #1328

Merged
merged 9 commits into from
Mar 16, 2023

Conversation

viclafargue
Copy link
Contributor

@viclafargue viclafargue commented Mar 10, 2023

Update and standardize IVF indexes API + edits on specializations

Copy link
Contributor

@achirkin achirkin left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Would you mind moving the 'xxx_params' to a second argument in all apis instead of the last one? That will be "much less breaking" change, because the initial implementation, both public and detail, followed this pattern.

Copy link
Member

@cjnolet cjnolet left a comment

Choose a reason for hiding this comment

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

Thanks for fixing these changes. It's look good so far but want to make sure we are still being consistent with the other APIs in the codebase.

For consistency, we use the following order of arguments always:

  1. Handle
  2. Params structs
  3. In
  4. Out
  5. Additional (non struct) parameters

cpp/bench/neighbors/knn.cuh Outdated Show resolved Hide resolved
cpp/bench/neighbors/knn.cuh Outdated Show resolved Hide resolved
cpp/include/raft/neighbors/ivf_flat.cuh Outdated Show resolved Hide resolved
@cjnolet cjnolet added improvement Improvement / enhancement to an existing function breaking Breaking change labels Mar 11, 2023
Copy link
Member

@cjnolet cjnolet left a comment

Choose a reason for hiding this comment

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

PR is looking good. I think just some updates to the docs of the arguments to consistently use [in], [out] and [inout] everywhere.

cpp/include/raft/neighbors/ivf_flat.cuh Outdated Show resolved Hide resolved
cpp/include/raft/neighbors/ivf_pq.cuh Outdated Show resolved Hide resolved
cpp/include/raft/neighbors/ivf_flat.cuh Outdated Show resolved Hide resolved
@divyegala
Copy link
Member

Please revert changes to ivf_flat from this PR. I am already working on that here #1316

@@ -37,3 +38,6 @@ cdef device_matrix_view[int8_t, int64_t, row_major] get_dmv_int8(

cdef device_matrix_view[int64_t, int64_t, row_major] get_dmv_int64(
array, check_shape) except *

cdef optional[device_matrix_view[int64_t, int64_t, row_major]] create_optional(
Copy link
Member

Choose a reason for hiding this comment

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

I don't know if cython will allow automatic overloads of this based on type, will it? We might need to rename this something like make_optional_view_int64 or something.

Copy link
Member

@cjnolet cjnolet left a comment

Choose a reason for hiding this comment

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

This looks good to me so I'm approving. I think we should visit the create_optional overload in an immediate follow-on though. What do you think?

@viclafargue
Copy link
Contributor Author

This looks good to me so I'm approving. I think we should visit the create_optional overload in an immediate follow-on though. What do you think?

Sure, we can merge as is, and do the renaming in a follow-up PR.

@cjnolet
Copy link
Member

cjnolet commented Mar 16, 2023

/merge

@rapids-bot rapids-bot bot merged commit 9f2a64f into rapidsai:branch-23.04 Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking change cpp improvement Improvement / enhancement to an existing function python
Projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants