Skip to content

Spectral Embedding #871

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

Draft
wants to merge 20 commits into
base: branch-25.08
Choose a base branch
from
Draft

Conversation

aamijar
Copy link
Member

@aamijar aamijar commented May 4, 2025

No description provided.

Copy link

copy-pr-bot bot commented May 4, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@aamijar aamijar added feature request New feature or request non-breaking Introduces a non-breaking change labels May 4, 2025
@aamijar aamijar self-assigned this May 4, 2025
raft::copy(knn_coo.cols(), knn_cols.data_handle(), nnz, stream);
raft::copy(knn_coo.vals(), d_distances.data_handle(), nnz, stream);

raft::sparse::COO<float> coo_no_zeros(stream); // Don't pre-allocate dimensions
Copy link
Member

Choose a reason for hiding this comment

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

It's okay to use this API in internal code, but we need to make sure we're using the new raft sparse coo_matrix_view in any public APIs. raft::sparse::COO is deprecated and we'll eventually have to change this call. Please create an issue in RAFT for updating this call to use the new raft sparse API types and reference that issue here for completeness. That way we can do a simple grep to find this and fix it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm currently working on using the new coo_matrix types and adding support for the relevant functions in raft. Tracking here: rapidsai/raft#2659 rapidsai/raft#2656
Although I'm running into some cuda invalid memory accesses and I can't seem to debug why its happening. It was passing with my gtests, but when I connected it with cuML it didn't pass the pytests. I've narrowed it down to fail in the gtests when I call transform twice in a row.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, I think I found the issue which is that I needed to initialize some vectors with zeros.

const int one = sym_coo.nnz;
raft::copy(row_ind.data_handle() + row_ind.size() - 1, &one, 1, stream);

auto csr_structure = raft::make_device_compressed_structure_view<int, int, int>(
Copy link
Member

Choose a reason for hiding this comment

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

You are ure using this here- why not also use the coo version above? That'll save us a lot of refactoring time in the future.

Copy link
Member Author

Choose a reason for hiding this comment

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

The new csr matrix types are supported in laplacian and lanczos functions. The new coo matrix types aren't supported in the functions where I need them, so that's why I am using the legacy ones. However, I'm trying to migrate to use the new types but currently stuck debugging #871 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

Now that you've been able to wrap this through cuML, can you provide a sense of the speedup for different datasets? It would be super helpful to know what we are working with here.

uint64_t seed;
};

// template <typename IndexTypeT, typename ValueTypeT>
Copy link
Member Author

Choose a reason for hiding this comment

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

enable support for <uint32_t/uint64_t, float/double>

@aamijar aamijar changed the base branch from branch-25.06 to branch-25.08 June 14, 2025 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake cpp feature request New feature or request non-breaking Introduces a non-breaking change
Projects
Development

Successfully merging this pull request may close these issues.

2 participants