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

HITS C API implementation #2150

Merged

Conversation

ChuckHastings
Copy link
Collaborator

Closes #2092

Provide the C API implementation for HITS. Adds a unit tester for MG, updates the unit tests for both SG and MG.

@ChuckHastings ChuckHastings requested review from a team as code owners March 23, 2022 14:57
@ChuckHastings ChuckHastings self-assigned this Mar 23, 2022
@ChuckHastings ChuckHastings added 3 - Ready for Review improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Mar 23, 2022
@ChuckHastings ChuckHastings added this to the 22.04 milestone Mar 23, 2022
@BradReesWork BradReesWork requested a review from seunghwak March 23, 2022 16:11
d_vertices.begin(),
d_vertices.end(),
d_values.begin(),
[key_func = cugraph::detail::compute_gpu_id_from_vertex_t<vertex_t>{comm_size}] __device__(
Copy link
Contributor

@seunghwak seunghwak Mar 23, 2022

Choose a reason for hiding this comment

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

Have you tested with initial guess hub values? If I am not mistaken, you're calling this after renumbering, but cugrpah::detail::compute_gpu_id_from_vertex_t expects original (before renumbering) vertex IDs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

adding a test in the next push. Refactored this code as you suggested.

@codecov-commenter
Copy link

codecov-commenter commented Mar 23, 2022

Codecov Report

Merging #2150 (7f5cf33) into branch-22.04 (5255aad) will increase coverage by 0.04%.
The diff coverage is n/a.

❗ Current head 7f5cf33 differs from pull request most recent head 38d63f8. Consider uploading reports for the commit 38d63f8 to get more accurate results

@@               Coverage Diff                @@
##           branch-22.04    #2150      +/-   ##
================================================
+ Coverage         73.95%   73.99%   +0.04%     
================================================
  Files               157      157              
  Lines             10496    10496              
================================================
+ Hits               7762     7767       +5     
+ Misses             2734     2729       -5     
Impacted Files Coverage Δ
.../cugraph/tests/test_edge_betweenness_centrality.py 84.93% <0.00%> (+0.60%) ⬆️
...graph/cugraph/tests/test_betweenness_centrality.py 83.01% <0.00%> (+0.62%) ⬆️
python/cugraph/cugraph/tests/test_graph_store.py 100.00% <0.00%> (+1.56%) ⬆️
python/cugraph/cugraph/tests/test_utils.py 75.55% <0.00%> (+4.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5255aad...38d63f8. Read the comment docs.

cpp/src/c_api/hits.cpp Show resolved Hide resolved
cpp/src/c_api/hits.cpp Outdated Show resolved Hide resolved
vertex_t local_vertex_first,
vertex_t local_vertex_last,
value_t default_value,
bool do_expensive_check);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need this function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We are using this function, I think it addresses what you are suggesting needs to be done.
collect_renumber_ext_vertex_values_to_local does:

  • shuffle to get ext vertex values to the proper GPU
  • local renumber of ext vertices
  • scatter to populate our dense vertex property arrays

If I can rename the function to make it more clear that these steps are what is done, I'm open to a better name.

Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha, so this function gets actually updated to implement the new logic.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe something like collect_local_vertex_values_from_ext_vertex_value_pairs... ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good. I'll update the function name.

@ChuckHastings
Copy link
Collaborator Author

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 87be0b3 into rapidsai:branch-22.04 Mar 29, 2022
@ChuckHastings ChuckHastings deleted the fea_hits_capi_implementation branch March 31, 2022 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Expose HITS through the C API
4 participants