Skip to content

Add function for calculating the mutual_reachability_graph#323

Merged
rapids-bot[bot] merged 16 commits intorapidsai:branch-24.10from
benfred:reachability
Oct 2, 2024
Merged

Add function for calculating the mutual_reachability_graph#323
rapids-bot[bot] merged 16 commits intorapidsai:branch-24.10from
benfred:reachability

Conversation

@benfred
Copy link
Copy Markdown
Contributor

@benfred benfred commented Sep 11, 2024

No description provided.

@benfred benfred added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Sep 11, 2024
@benfred benfred self-assigned this Sep 11, 2024
int min_samples,
raft::device_vector_view<int64_t> indptr,
raft::device_vector_view<float> core_dists,
raft::sparse::COO<float, int64_t>& out,
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.

Small nitpick- this sparse::COO class is going away completely and it's really not designed well. Can we swap this out for the raft::sparsity_owning_coo_matrix? I think we can do a view since we already know the size, right?

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.

It's also okay if the answer is "time is running out, let's change that later"

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.

One challenge here is that we'd have to add support in RAFT for device_coo_matrix_view / device_sparsity_owning_coo_matrix to some sparse algorithms like raft::sparse::linalg::symmetrize andraft::sparse::convert::sorted_coo_to_csr - which only accept the raft::sparse::COO class. This shouldn't be too hard to do though -

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.

Underneath the public API, we can just use the arrays / existing types. But I’d like to get to a point where we are using the new types at least for new public APIs. Eventually we need to scrape through all the sparse APIs and use the new types everywhere. However new APIs could at least use the new types in the meantime.

Can you create an issue for this? I think we are running out of time to do it for 24.10.

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.

Created an issue here #369

@cjnolet cjnolet marked this pull request as ready for review September 27, 2024 03:20
@cjnolet cjnolet requested review from a team as code owners September 27, 2024 03:20
Copy link
Copy Markdown
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.

Approving because my only comment is asking to create an issue or tracker issue for consolidating templates.

bool select_min,
bool sorted = false,
SelectAlgo algo = SelectAlgo::kAuto,
std::optional<raft::device_vector_view<const int, int64_t>> len_i = std::nullopt);
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.

It's saddening to see having to add this in here just for int type. Can you create an issue or maybe even a larger tracker issue with some follow-up tasks and add consolidating these type instantiations to that? Similar to the other types, it would be great if we could establish a single set of common integral types and maybe even consolidate float/double just into float.

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.

I've added an issue here #370 for consolidating the template params -

const DistanceT* precomputed_search_norms = nullptr,
const uint32_t* filter_bitmap = nullptr)
const uint32_t* filter_bitmap = nullptr,
DistanceEpilogue distance_epilogue = raft::identity_op())
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.

Unfortunate we have to instantiate bfknn twice now :-( but great that we don't have to expose the eilogue through the public APIs. Hopefully at some point soon we'll establish a good way to specify these (maybe as JIT compiled functions) through the public APIs where we don't need to instanaite all the kernels end to end for each one.

@benfred
Copy link
Copy Markdown
Contributor Author

benfred commented Oct 2, 2024

/merge

@rapids-bot rapids-bot Bot merged commit ce01a0b into rapidsai:branch-24.10 Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake cpp improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants