-
Notifications
You must be signed in to change notification settings - Fork 310
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
C API for creating a graph #1907
C API for creating a graph #1907
Conversation
Codecov Report
@@ Coverage Diff @@
## branch-21.12 #1907 +/- ##
===============================================
Coverage ? 70.17%
===============================================
Files ? 143
Lines ? 8863
Branches ? 0
===============================================
Hits ? 6220
Misses ? 2643
Partials ? 0 Continue to review full report at Codecov.
|
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.
Looks good in general, and I have few minor comments.
cpp/include/cugraph_c/algorithms.h
Outdated
bool has_initial_guess, | ||
bool do_expensive_check, | ||
cugraph_type_erased_device_array_t** vertex_ids, | ||
cugraph_type_erased_device_array_t** pageranks); |
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.
Why are these "pointer of pointer"?
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.
Recent change.
My recent thought (mentioned in the PR description) is to have renumbering hidden in the C API. With renumbering hidden in the C API, my assumption (unvalidated) is that in a multi-GPU mode I might not know a priori the exact size of the vertex_ids and pageranks array on each node. Thus the memory would be allocated internally.
The functions had been returning a cugraph_type_erased_device_array_t *
, making "pointer of pointer" was the easiest way to accommodate this change.
I could make the function require them to be preallocated as input, but you couldn't allocate them on the stack (as currently implemented) because the structure is opaque. They would have to be allocated with the cugraph_type_erased_device_array_create
function and then passed in. If the shape of the structure changed (because of renumbering in an MNMG context) they could then be changed in place.
This felt more "C"-like for the pointer to memory allocated inside the function.
cpp/include/cugraph_c/algorithms.h
Outdated
* @param [out] pageranks Returns device pointer to pagerank scores | ||
* @return error code | ||
*/ | ||
cugraph_error_t pagerank( |
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.
So, we discussed about returning auxiliary information. Not a task for this PR, but we may consider returning something like pagerank_aux_info_t as a wrapper of cugraph_error_t to include additional information 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.
I'm leaning toward having all functions either return void or cugraph_error_t - for consistency.
We could pass a pointer to a pagerank_aux_info_t as a parameter for updating auxiliary information.
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.
See
https://github.com/rapidsai/cugraph/pull/1898/files#r737789888
and
https://github.com/rapidsai/cugraph/pull/1898/files#r737799789
We need a consistent strategy to return auxiliary information.
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.
Added some comments to the HITS PR.
That makes sense to me. I'll update the algorithm APIs to reflect this notion.
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.
Just pushed an update that handles this.
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.
Looks good, I just had a few suggestions.
rerun tests |
@gpucibot merge |
rerun tests |
1 similar comment
rerun tests |
Partially addresses #1906
This PR defines the API for graph creation and the pagerank and bfs calls that we will use to experiment with transposing a graph.
Some notes on the design here.
store_transposed=true
orstore_transposed=false
and will call the transpose method if required.