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

Fixing cugraph for RAFT spectral/lap API changes #2067

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions cpp/src/community/legacy/spectral_clustering.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2021, NVIDIA CORPORATION.
* Copyright (c) 2020-2022, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -92,15 +92,15 @@ void balancedCutClustering_impl(legacy::GraphCSRView<vertex_t, edge_t, weight_t>
using index_type = vertex_t;
using value_type = weight_t;

raft::matrix::sparse_matrix_t<index_type, value_type> const r_csr_m{handle, graph};
raft::spectral::matrix::sparse_matrix_t<index_type, value_type> const r_csr_m{handle, graph};

raft::eigen_solver_config_t<index_type, value_type> eig_cfg{
raft::spectral::eigen_solver_config_t<index_type, value_type> eig_cfg{
n_eig_vects, evs_max_it, restartIter_lanczos, evs_tol, reorthog, seed};
raft::lanczos_solver_t<index_type, value_type> eig_solver{eig_cfg};
raft::spectral::lanczos_solver_t<index_type, value_type> eig_solver{eig_cfg};

raft::cluster_solver_config_t<index_type, value_type> clust_cfg{
raft::spectral::cluster_solver_config_t<index_type, value_type> clust_cfg{
n_clusters, kmean_max_it, kmean_tol, seed};
raft::kmeans_solver_t<index_type, value_type> cluster_solver{clust_cfg};
raft::spectral::kmeans_solver_t<index_type, value_type> cluster_solver{clust_cfg};

raft::spectral::partition(
handle, r_csr_m, eig_solver, cluster_solver, clustering, eig_vals, eig_vects);
Expand Down Expand Up @@ -160,15 +160,15 @@ void spectralModularityMaximization_impl(
using index_type = vertex_t;
using value_type = weight_t;

raft::matrix::sparse_matrix_t<index_type, value_type> const r_csr_m{handle, graph};
raft::spectral::matrix::sparse_matrix_t<index_type, value_type> const r_csr_m{handle, graph};

raft::eigen_solver_config_t<index_type, value_type> eig_cfg{
raft::spectral::eigen_solver_config_t<index_type, value_type> eig_cfg{
n_eig_vects, evs_max_it, restartIter_lanczos, evs_tol, reorthog, seed};
raft::lanczos_solver_t<index_type, value_type> eig_solver{eig_cfg};
raft::spectral::lanczos_solver_t<index_type, value_type> eig_solver{eig_cfg};

raft::cluster_solver_config_t<index_type, value_type> clust_cfg{
raft::spectral::cluster_solver_config_t<index_type, value_type> clust_cfg{
n_clusters, kmean_max_it, kmean_tol, seed};
raft::kmeans_solver_t<index_type, value_type> cluster_solver{clust_cfg};
raft::spectral::kmeans_solver_t<index_type, value_type> cluster_solver{clust_cfg};

// not returned...
// auto result =
Expand All @@ -192,7 +192,7 @@ void analyzeModularityClustering_impl(legacy::GraphCSRView<vertex_t, edge_t, wei
using index_type = vertex_t;
using value_type = weight_t;

raft::matrix::sparse_matrix_t<index_type, value_type> const r_csr_m{handle, graph};
raft::spectral::matrix::sparse_matrix_t<index_type, value_type> const r_csr_m{handle, graph};

weight_t mod;
raft::spectral::analyzeModularity(handle, r_csr_m, n_clusters, clustering, mod);
Expand All @@ -218,7 +218,7 @@ void analyzeBalancedCut_impl(legacy::GraphCSRView<vertex_t, edge_t, weight_t> co
using index_type = vertex_t;
using value_type = weight_t;

raft::matrix::sparse_matrix_t<index_type, value_type> const r_csr_m{handle, graph};
raft::spectral::matrix::sparse_matrix_t<index_type, value_type> const r_csr_m{handle, graph};

raft::spectral::analyzePartition(handle, r_csr_m, n_clusters, clustering, edge_cut, cost);

Expand Down
4 changes: 2 additions & 2 deletions cpp/src/linear_assignment/hungarian.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2021, NVIDIA CORPORATION.
* Copyright (c) 2020-2022, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,7 @@
#include <cugraph/legacy/graph.hpp>
#include <cugraph/utilities/error.hpp>

#include <raft/lap/lap.cuh>
#include <raft/lap/lap.hpp>

#include <rmm/cuda_stream_view.hpp>
#include <rmm/device_uvector.hpp>
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/utilities/spmv_1D.cu
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ MGcsrmv<vertex_t, edge_t, weight_t>::~MGcsrmv()
template <typename vertex_t, typename edge_t, typename weight_t>
void MGcsrmv<vertex_t, edge_t, weight_t>::run(weight_t* x)
{
using namespace raft::matrix;
using namespace raft::spectral::matrix;

weight_t h_one = 1.0;
weight_t h_zero = 0.0;
Expand Down