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

DBSCAN utilize rbc eps_neighbors #5728

Merged
merged 29 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
503b474
enable multiclass svm for sparse input
mfoerste4 Sep 27, 2023
7014e72
Merge branch 'branch-23.10' into enable_sparse_multiclass_svm
tfeher Oct 4, 2023
d2d996c
Merge branch 'rapidsai:branch-23.10' into enable_sparse_multiclass_svm
mfoerste4 Oct 6, 2023
a44a2ef
review suggestions
mfoerste4 Oct 7, 2023
bd670c9
Merge branch 'branch-23.12' into enable_sparse_multiclass_svm
mfoerste4 Oct 16, 2023
6318451
move utility to internals
mfoerste4 Oct 16, 2023
3e30879
enable rbc for neighbor compute
mfoerste4 Oct 18, 2023
2a0ddb2
only use rbc for 2/3-D data
mfoerste4 Oct 18, 2023
3eff18e
use CSR adjacency matrix
mfoerste4 Oct 25, 2023
4029fcd
api adjustments
mfoerste4 Jan 15, 2024
391eeea
merge 24.02
mfoerste4 Jan 15, 2024
0fdbe2c
Merge branch 'rapidsai:branch-24.02' into rbc_eps_neighbors
mfoerste4 Jan 23, 2024
20beba4
adjust to new API
mfoerste4 Jan 23, 2024
c26d498
conservative eps_nn memory management
mfoerste4 Jan 23, 2024
72e1225
add comment to force re-test
mfoerste4 Jan 24, 2024
d023c95
further restrict rbc mode for now
mfoerste4 Jan 24, 2024
b2e1312
make eps_nn method choice a user parameter, also add optimization to …
mfoerste4 Jan 30, 2024
9e190ca
Merge branch 'branch-24.02' into rbc_eps_neighbors
mfoerste4 Jan 30, 2024
2dc1636
Merge branch 'branch-24.04' into rbc_eps_neighbors
mfoerste4 Feb 6, 2024
226a65c
Merge branch 'branch-24.04' into rbc_eps_neighbors
mfoerste4 Feb 20, 2024
8f64212
align algorithm choice in DBSCAN with sklearn
mfoerste4 Feb 20, 2024
7864155
add missing key to get_param_names
mfoerste4 Feb 22, 2024
3fc1a65
Merge branch 'branch-24.04' into rbc_eps_neighbors
mfoerste4 Feb 22, 2024
b2c6c4f
Merge branch 'branch-24.04' into rbc_eps_neighbors
mfoerste4 Feb 28, 2024
199cb54
Merge branch 'branch-24.04' into rbc_eps_neighbors
mfoerste4 Mar 8, 2024
932bb0e
Merge branch 'branch-24.04' into rbc_eps_neighbors
mfoerste4 Mar 8, 2024
213fa5b
fix headers after conflict with new inlude policy
mfoerste4 Mar 8, 2024
f35bf15
some dummy change to trigger CI
mfoerste4 Mar 8, 2024
36b4c62
Merge branch 'branch-24.04' into rbc_eps_neighbors
mfoerste4 Mar 11, 2024
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
1 change: 1 addition & 0 deletions cpp/examples/dbscan/dbscan_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ int main(int argc, char* argv[])
nullptr,
nullptr,
max_bytes_per_batch,
ML::Dbscan::EpsNnMethod::BRUTE_FORCE,
false);
CUDA_RT_CALL(cudaMemcpyAsync(
h_labels.data(), d_labels, nRows * sizeof(int), cudaMemcpyDeviceToHost, stream));
Expand Down
7 changes: 7 additions & 0 deletions cpp/include/cuml/cluster/dbscan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class handle_t;
namespace ML {
namespace Dbscan {

enum EpsNnMethod { BRUTE_FORCE, RBC };

/**
* @defgroup DbscanCpp C++ implementation of Dbscan algo
* @brief Fits a DBSCAN model on an input feature matrix and outputs the labels
Expand All @@ -53,6 +55,7 @@ namespace Dbscan {
* @param[in] max_bytes_per_batch the maximum number of megabytes to be used for
* each batch of the pairwise distance calculation. This enables the
* trade off between memory usage and algorithm execution time.
* @param[in] eps_nn_method method for computing epsilon neighborhood
* @param[in] verbosity verbosity level for logging messages during execution
* @param[in] opg whether we are running in a multi-node multi-GPU context
* @{
Expand All @@ -69,6 +72,7 @@ void fit(const raft::handle_t& handle,
int* core_sample_indices = nullptr,
float* sample_weight = nullptr,
size_t max_bytes_per_batch = 0,
EpsNnMethod eps_nn_method = BRUTE_FORCE,
int verbosity = CUML_LEVEL_INFO,
bool opg = false);
void fit(const raft::handle_t& handle,
Expand All @@ -82,6 +86,7 @@ void fit(const raft::handle_t& handle,
int* core_sample_indices = nullptr,
double* sample_weight = nullptr,
size_t max_bytes_per_batch = 0,
EpsNnMethod eps_nn_method = BRUTE_FORCE,
int verbosity = CUML_LEVEL_INFO,
bool opg = false);

Expand All @@ -96,6 +101,7 @@ void fit(const raft::handle_t& handle,
int64_t* core_sample_indices = nullptr,
float* sample_weight = nullptr,
size_t max_bytes_per_batch = 0,
EpsNnMethod eps_nn_method = BRUTE_FORCE,
int verbosity = CUML_LEVEL_INFO,
bool opg = false);
void fit(const raft::handle_t& handle,
Expand All @@ -109,6 +115,7 @@ void fit(const raft::handle_t& handle,
int64_t* core_sample_indices = nullptr,
double* sample_weight = nullptr,
size_t max_bytes_per_batch = 0,
EpsNnMethod eps_nn_method = BRUTE_FORCE,
int verbosity = CUML_LEVEL_INFO,
bool opg = false);

Expand Down
12 changes: 12 additions & 0 deletions cpp/src/dbscan/dbscan.cu
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ void fit(const raft::handle_t& handle,
int* core_sample_indices,
float* sample_weight,
size_t max_bytes_per_batch,
EpsNnMethod eps_nn_method,
int verbosity,
bool opg)
{
Expand All @@ -49,6 +50,7 @@ void fit(const raft::handle_t& handle,
core_sample_indices,
sample_weight,
max_bytes_per_batch,
eps_nn_method,
handle.get_stream(),
verbosity);
else
Expand All @@ -63,6 +65,7 @@ void fit(const raft::handle_t& handle,
core_sample_indices,
sample_weight,
max_bytes_per_batch,
eps_nn_method,
handle.get_stream(),
verbosity);
}
Expand All @@ -78,6 +81,7 @@ void fit(const raft::handle_t& handle,
int* core_sample_indices,
double* sample_weight,
size_t max_bytes_per_batch,
EpsNnMethod eps_nn_method,
int verbosity,
bool opg)
{
Expand All @@ -93,6 +97,7 @@ void fit(const raft::handle_t& handle,
core_sample_indices,
sample_weight,
max_bytes_per_batch,
eps_nn_method,
handle.get_stream(),
verbosity);
else
Expand All @@ -107,6 +112,7 @@ void fit(const raft::handle_t& handle,
core_sample_indices,
sample_weight,
max_bytes_per_batch,
eps_nn_method,
handle.get_stream(),
verbosity);
}
Expand All @@ -122,6 +128,7 @@ void fit(const raft::handle_t& handle,
int64_t* core_sample_indices,
float* sample_weight,
size_t max_bytes_per_batch,
EpsNnMethod eps_nn_method,
int verbosity,
bool opg)
{
Expand All @@ -137,6 +144,7 @@ void fit(const raft::handle_t& handle,
core_sample_indices,
sample_weight,
max_bytes_per_batch,
eps_nn_method,
handle.get_stream(),
verbosity);
else
Expand All @@ -151,6 +159,7 @@ void fit(const raft::handle_t& handle,
core_sample_indices,
sample_weight,
max_bytes_per_batch,
eps_nn_method,
handle.get_stream(),
verbosity);
}
Expand All @@ -166,6 +175,7 @@ void fit(const raft::handle_t& handle,
int64_t* core_sample_indices,
double* sample_weight,
size_t max_bytes_per_batch,
EpsNnMethod eps_nn_method,
int verbosity,
bool opg)
{
Expand All @@ -181,6 +191,7 @@ void fit(const raft::handle_t& handle,
core_sample_indices,
sample_weight,
max_bytes_per_batch,
eps_nn_method,
handle.get_stream(),
verbosity);
else
Expand All @@ -195,6 +206,7 @@ void fit(const raft::handle_t& handle,
core_sample_indices,
sample_weight,
max_bytes_per_batch,
eps_nn_method,
handle.get_stream(),
verbosity);
}
Expand Down
3 changes: 3 additions & 0 deletions cpp/src/dbscan/dbscan.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ void dbscanFitImpl(const raft::handle_t& handle,
Index_* core_sample_indices,
T* sample_weight,
size_t max_mbytes_per_batch,
EpsNnMethod eps_nn_method,
cudaStream_t stream,
int verbosity)
{
Expand Down Expand Up @@ -184,6 +185,7 @@ void dbscanFitImpl(const raft::handle_t& handle,
algo_ccl,
NULL,
batch_size,
eps_nn_method,
stream,
metric);

Expand All @@ -206,6 +208,7 @@ void dbscanFitImpl(const raft::handle_t& handle,
algo_ccl,
workspace.data(),
batch_size,
eps_nn_method,
stream,
metric);
}
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/dbscan/dbscan_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ cumlError_t cumlSpDbscanFit(cumlHandle_t handle,
core_sample_indices,
NULL,
max_bytes_per_batch,
ML::Dbscan::EpsNnMethod::BRUTE_FORCE,
verbosity);
}
// TODO: Implement this
Expand Down Expand Up @@ -91,6 +92,7 @@ cumlError_t cumlDpDbscanFit(cumlHandle_t handle,
core_sample_indices,
NULL,
max_bytes_per_batch,
ML::Dbscan::EpsNnMethod::BRUTE_FORCE,
verbosity);
}
// TODO: Implement this
Expand Down
Loading
Loading