-
Notifications
You must be signed in to change notification settings - Fork 300
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
Build a Dendrogram class, adapt Louvain/Leiden/ECG to use it #1359
Merged
rapids-bot
merged 21 commits into
rapidsai:branch-0.18
from
ChuckHastings:fea_louvain_dendogram
Feb 5, 2021
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
ab335b7
create a dendogram in the C++ code
ChuckHastings 4d984c6
fix clang format issues
ChuckHastings 9c276ae
update copyright date
ChuckHastings 0ded26d
Merge branch 'branch-0.18' into fea_louvain_dendogram
ChuckHastings 637aee1
New idea for ECG
ChuckHastings 7187bdb
Merge branch 'branch-0.18' into fea_louvain_dendogram
ChuckHastings 347051c
rename ECG to make it consistent
ChuckHastings 755c298
missed renaming ECG in CMakeLists.txt
ChuckHastings 142024c
Merge branch 'branch-0.18' into fea_louvain_dendogram
ChuckHastings 07ad090
fix spelling of dendrogram, fix clang formatting issues
ChuckHastings becbc63
Merge branch 'branch-0.18' into fea_louvain_dendogram
ChuckHastings bc3f26d
address comments from PR
ChuckHastings a3dd26d
Merge branch 'branch-0.18' into fea_louvain_dendogram
ChuckHastings 84d3bf1
add checks for Pascal architecture in Louvain derived tests
ChuckHastings 2e89e2c
reformat and update copyright dates
ChuckHastings 825d6af
a few more flake8 errors
ChuckHastings 4f0453e
Merge branch 'branch-0.18' into fea_louvain_dendogram
ChuckHastings 9afc8de
refactor notebook tests to make it easier to filter tests; filter out…
ChuckHastings 3db5697
delete some unused code in script
ChuckHastings d40f5a0
misspelled update from Rick
ChuckHastings 9532b13
add early breaks, fix copyright dates
ChuckHastings File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
New idea for ECG
1) Separate flatten_dendogram from dendogram class 2) Add initialize_dendogram_level function 3) Created an ECG variation of Louvain that initializes the dendogram with a random ordering of vertex ids rather than creating a new graph.
- Loading branch information
commit 637aee19b092fc1fff3045fd4210b3f5754aa9f1
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (c) 2021, NVIDIA CORPORATION. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
#pragma once | ||
|
||
#include <community/dendogram.cuh> | ||
#include <experimental/graph_functions.hpp> | ||
#include <raft/handle.hpp> | ||
|
||
namespace cugraph { | ||
|
||
template <typename vertex_t, bool multi_gpu> | ||
void partition_at_level(raft::handle_t const &handle, | ||
Dendogram<vertex_t> const &dendogram, | ||
vertex_t const *d_vertex_ids, | ||
vertex_t *d_partition, | ||
size_t level) | ||
{ | ||
vertex_t local_num_verts = dendogram.get_level_size_unsafe(0); | ||
|
||
thrust::copy( | ||
rmm::exec_policy(handle.get_stream())->on(handle.get_stream()), | ||
d_vertex_ids, | ||
d_vertex_ids + local_num_verts, | ||
d_partition); | ||
|
||
std::for_each(thrust::make_counting_iterator<size_t>(0), | ||
thrust::make_counting_iterator<size_t>(level), | ||
[&handle, &dendogram, d_vertex_ids, &d_partition, local_num_verts](size_t l) { | ||
cugraph::experimental::relabel<vertex_t, multi_gpu>( | ||
handle, | ||
std::tuple<vertex_t const *, vertex_t const *>( | ||
d_vertex_ids, dendogram.get_level_ptr_unsafe(l)), | ||
dendogram.get_level_size_unsafe(l), | ||
d_partition, | ||
local_num_verts); | ||
}); | ||
} | ||
|
||
} // namespace cugraph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're not dealing with non-arithmetic types, rmm::device_uvector will be more efficient and more stream ready.
Note that rmm::device_uvector does not invoke default constructor to initialize vector elements, so if your code expects initialization, you need to call thrust::fill().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed in the next push.