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

Updates to enable HDBSCAN #208

Merged
merged 40 commits into from
May 27, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
046f703
Allowing epilogue in knn graph connection function
cjnolet Apr 20, 2021
086b08a
Fixing style
cjnolet Apr 20, 2021
37d2e0d
Adding missing argument
cjnolet Apr 23, 2021
709c040
Fixing typename
cjnolet Apr 23, 2021
b1fbc63
Updates
cjnolet Apr 23, 2021
81b630a
Fixing style
cjnolet Apr 23, 2021
6c52542
Updating to get hdbscan to compile
cjnolet Apr 23, 2021
4be3d24
Some updates
cjnolet Apr 26, 2021
1aaa7d5
changes
cjnolet Apr 29, 2021
dd6e537
agglomerative labeling to accept device arrays directly
cjnolet Apr 30, 2021
e3085cb
Cleaning up inputs to some of the single linkage prims
cjnolet Apr 30, 2021
ec1cca5
removing deprecated rmm policy usage
divyegala May 4, 2021
d32677d
Changes
cjnolet May 5, 2021
43f7cf8
removing deprecated rmm policy usage
divyegala May 4, 2021
e0ef5b3
alpha to weight alteration for precision
divyegala May 10, 2021
d809630
merge
divyegala May 10, 2021
1678c66
resolving errors
divyegala May 10, 2021
8018ea5
merge again
divyegala May 10, 2021
404e5ce
Merge branch 'fea-020-hdbscan' of github.com:cjnolet/raft into fea-02…
divyegala May 10, 2021
5eda4aa
trying alpha for all
divyegala May 11, 2021
030b3a9
double precision weight alteration
divyegala May 12, 2021
635d018
Checking in
cjnolet May 14, 2021
26dff4d
Fixing style
cjnolet May 19, 2021
55f274c
Removing unused epilogue from mst
cjnolet May 19, 2021
eb69413
Removing mst epilogue functor
cjnolet May 19, 2021
9f39d69
Merge branch 'branch-0.20' into fea-020-hdbscan
cjnolet May 19, 2021
dfebf10
Merge branch 'branch-21.06' into fea-020-hdbscan
cjnolet May 19, 2021
50d1cdc
Getting test to build
cjnolet May 20, 2021
c654156
Removing mstepiloguenoop since it's no longer being used
cjnolet May 22, 2021
136529a
another template param for weight alteration
divyegala May 24, 2021
e4b0f91
merge upstream
divyegala May 24, 2021
d7e93d9
renaming confusing variable name
divyegala May 24, 2021
e51d08b
working through merge
divyegala May 26, 2021
beea020
merging mst template PR
divyegala May 26, 2021
86cbf42
removing unnecessary comments
divyegala May 26, 2021
eb92e26
Review feedback
cjnolet May 27, 2021
e337c0d
Merge branch 'branch-21.06' into fea-020-hdbscan
cjnolet May 27, 2021
8b1e344
Update cpp/include/raft/sparse/hierarchy/detail/agglomerative.cuh
cjnolet May 27, 2021
1933520
Fixing bad merge
cjnolet May 27, 2021
1bc3e68
Merge branch 'fea-020-hdbscan' of github.com:cjnolet/raft into fea-02…
cjnolet May 27, 2021
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
Prev Previous commit
Next Next commit
removing deprecated rmm policy usage
  • Loading branch information
divyegala committed May 4, 2021
commit ec1cca59ab1076fdd083aac97b1b8a698570e984
29 changes: 14 additions & 15 deletions cpp/include/raft/sparse/mst/detail/mst_solver_inl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ MST_solver<vertex_t, edge_t, weight_t>::MST_solver(
//Initially, color holds the vertex id as color
auto policy = rmm::exec_policy(stream);
if (initialize_colors_) {
thrust::sequence(policy->on(stream), color.begin(), color.end(), 0);
thrust::sequence(policy->on(stream), color_index, color_index + v, 0);
thrust::sequence(policy, color.begin(), color.end(), 0);
thrust::sequence(policy, color_index, color_index + v, 0);
} else {
raft::copy(color.data().get(), color_index, v, stream);
}
thrust::sequence(policy->on(stream), next_color.begin(), next_color.end(), 0);
thrust::sequence(policy, next_color.begin(), next_color.end(), 0);
}

template <typename vertex_t, typename edge_t, typename weight_t>
Expand Down Expand Up @@ -212,22 +212,22 @@ weight_t MST_solver<vertex_t, edge_t, weight_t>::alteration_max() {
auto policy = rmm::exec_policy(stream);
rmm::device_vector<weight_t> tmp(e);
thrust::device_ptr<const weight_t> weights_ptr(weights);
thrust::copy(policy->on(stream), weights_ptr, weights_ptr + e, tmp.begin());
thrust::copy(policy, weights_ptr, weights_ptr + e, tmp.begin());
//sort tmp weights
thrust::sort(policy->on(stream), tmp.begin(), tmp.end());
thrust::sort(policy, tmp.begin(), tmp.end());

//remove duplicates
auto new_end = thrust::unique(policy->on(stream), tmp.begin(), tmp.end());
auto new_end = thrust::unique(policy, tmp.begin(), tmp.end());

//min(a[i+1]-a[i])/2
auto begin =
thrust::make_zip_iterator(thrust::make_tuple(tmp.begin(), tmp.begin() + 1));
auto end =
thrust::make_zip_iterator(thrust::make_tuple(new_end - 1, new_end));
auto init = tmp[1] - tmp[0];
auto max = thrust::transform_reduce(policy->on(stream), begin, end,
alteration_functor<weight_t>(), init,
thrust::minimum<weight_t>());
auto max =
thrust::transform_reduce(policy, begin, end, alteration_functor<weight_t>(),
init, thrust::minimum<weight_t>());
return max / static_cast<weight_t>(2);
}

Expand Down Expand Up @@ -306,9 +306,9 @@ void MST_solver<vertex_t, edge_t, weight_t>::label_prop(vertex_t* mst_src,
template <typename vertex_t, typename edge_t, typename weight_t>
void MST_solver<vertex_t, edge_t, weight_t>::min_edge_per_vertex() {
auto policy = rmm::exec_policy(stream);
thrust::fill(policy->on(stream), min_edge_color.begin(), min_edge_color.end(),
thrust::fill(policy, min_edge_color.begin(), min_edge_color.end(),
std::numeric_limits<weight_t>::max());
thrust::fill(policy->on(stream), new_mst_edge.begin(), new_mst_edge.end(),
thrust::fill(policy, new_mst_edge.begin(), new_mst_edge.end(),
std::numeric_limits<weight_t>::max());

int n_threads = 32;
Expand All @@ -331,7 +331,7 @@ void MST_solver<vertex_t, edge_t, weight_t>::min_edge_per_supervertex() {
auto nblocks = std::min((v + nthreads - 1) / nthreads, max_blocks);

auto policy = rmm::exec_policy(stream);
thrust::fill(policy->on(stream), temp_src.begin(), temp_src.end(),
thrust::fill(policy, temp_src.begin(), temp_src.end(),
std::numeric_limits<vertex_t>::max());

vertex_t* color_ptr = color.data().get();
Expand Down Expand Up @@ -401,9 +401,8 @@ void MST_solver<vertex_t, edge_t, weight_t>::append_src_dst_pair(
thrust::make_tuple(temp_src.end(), temp_dst.end(), temp_weights.end()));

// copy new mst edges to final output
thrust::copy_if(policy->on(stream), temp_src_dst_zip_begin,
temp_src_dst_zip_end, src_dst_zip_end,
new_edges_functor<vertex_t, weight_t>());
thrust::copy_if(policy, temp_src_dst_zip_begin, temp_src_dst_zip_end,
src_dst_zip_end, new_edges_functor<vertex_t, weight_t>());
}

} // namespace mst
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/raft/sparse/mst/detail/utils.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

#pragma once

#include <rmm/thrust_rmm_allocator.h>
#include <iostream>
#include <rmm/device_vector.hpp>
#define MST_TIME

namespace raft {
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/raft/sparse/mst/mst_solver.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

#pragma once

#include <rmm/thrust_rmm_allocator.h>
#include <raft/handle.hpp>
#include <rmm/device_uvector.hpp>
#include <rmm/device_vector.hpp>

namespace raft {

Expand Down
1 change: 0 additions & 1 deletion cpp/test/mst.cu
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <bits/stdc++.h>

#include <gtest/gtest.h>
#include <rmm/thrust_rmm_allocator.h>
#include <iostream>
#include <rmm/device_buffer.hpp>
#include <vector>
Expand Down