-
Notifications
You must be signed in to change notification settings - Fork 312
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
Initial cuGraph C API - biased RW, C tests, script updates, cmake files, C library helpers #1799
Merged
rapids-bot
merged 73 commits into
rapidsai:branch-21.12
from
aschaffer:fea_ext_binding_rw_biased
Oct 7, 2021
Merged
Changes from 69 commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
acf15bc
Merge pull request #37 from rapidsai/branch-0.17
aschaffer a584e0b
Merge pull request #38 from rapidsai/branch-0.18
aschaffer 338b2d4
Merge pull request #39 from rapidsai/branch-0.18
aschaffer efd7e9a
Merge pull request #40 from rapidsai/branch-0.18
aschaffer a23ce0d
Merge pull request #41 from rapidsai/branch-0.19
aschaffer 22b32d8
Merge pull request #42 from rapidsai/branch-0.19
aschaffer e5042fc
Merge pull request #43 from rapidsai/branch-0.19
aschaffer ca02ee4
Merge pull request #44 from rapidsai/branch-0.19
aschaffer 79409e7
Merge pull request #45 from rapidsai/branch-0.20
aschaffer 360c293
Merge pull request #46 from rapidsai/branch-0.20
aschaffer e57f261
Merge pull request #47 from rapidsai/branch-0.20
aschaffer a63cdea
Merge pull request #48 from rapidsai/branch-21.08
aschaffer 7e6bf4c
Merge branch 'rapidsai:branch-21.08' into branch-21.08
aschaffer 6f3b342
Merge branch 'rapidsai:branch-21.08' into branch-21.08
aschaffer fbf5f36
Merge branch 'rapidsai:branch-21.10' into branch-21.10
aschaffer ffacad0
Merge branch 'rapidsai:branch-21.10' into branch-21.10
aschaffer beaf0fb
Merge branch 'branch-21.10' of github.com:rapidsai/cugraph into fea_e…
aschaffer 3b3131e
Merge branch 'branch-21.10' of https://github.com/rapidsai/cugraph in…
aschaffer 16a998f
Merge branch 'branch-21.10' of github.com:rapidsai/cugraph into fea_e…
aschaffer 03a2055
Prepare extended API for RW.
aschaffer b4fe88a
Merge branch 'branch-21.10' of github.com:rapidsai/cugraph into fea_e…
aschaffer b7b87a2
Preliminary RW type-erasure. Needs work.
aschaffer af0e21b
Fixed typed-erased return to work with move-only semantics. Fixed vis…
aschaffer 08a6ee7
RW visitor test.
aschaffer 0336827
Changed order of header inclusion to fix problematic warning.
aschaffer 4e40752
Proto C-API.
aschaffer 04110f6
Added a RW test utility function allowing raw pointers, for type-eras…
aschaffer c74ac7c
Type-erased return type to help the C-API avoid cascaded dispatch on …
aschaffer 267435a
Merge branch 'branch-21.10' of github.com:rapidsai/cugraph into fea_e…
aschaffer 43e5732
C-API: file / build structure and first files.
aschaffer 2d45309
Updates to consolidate the libcugraph C API with the cpp source tree.
rlratzel 1833356
Changed GLOBAL_TARGETS to include cugraph_c.
rlratzel 569792a
Changed C-API prefix.
aschaffer f5cead2
Fix merge conflicts.
aschaffer 903e93e
Prelim. graph reader visitor.
aschaffer fd85c38
Graph factory visitor.
aschaffer 6a87781
SG Graph factory visitor.
aschaffer fc00dd4
Fixed graph factory call to satisfy the graph_meta_t contract.
aschaffer a0752da
Added graph envelope factory to the erased API.
aschaffer 7a0cd27
Added graph allocator / deallocator implementation to the C-API.
aschaffer 7065363
Added (mostly placeholder) C tests for C API, updated CI scripts, upd…
rlratzel 53d4e18
Added temporary passing return code until test is finished.
rlratzel ff1637b
clang format fixes.
rlratzel 4829f6a
Temporarily returning success until test is finished.
rlratzel d696a6b
Adding FAISS to the list of libs to link for the C API library. Still…
rlratzel 7401159
Added other link libs as private to cover extra dependencies for comp…
rlratzel 80e7adc
Moving FAISS to PUBLIC section in order to have build find library lo…
rlratzel 4b85ee7
Moving all lib deps to public for now for consistency and to ensure a…
rlratzel 450e269
Moved libcugraph.so to private after confirming that a local build wo…
rlratzel 470835d
Added device_buffer management in the C-API.
aschaffer d3c112b
Merge branch 'fea_ext_binding_rw_biased' of github.com:aschaffer/cugr…
aschaffer 5e95b45
Simplified device buffer usage.
aschaffer 751435f
C-API raft::handle_t allocator/deallocator.
aschaffer afe39b7
C-API unique_ptr<sampling_params_t> allocator/deallocator.
aschaffer f5e0eac
C-API RW result deallocator.
aschaffer 6d33664
Fixed the missing exten 'C'.
aschaffer 45ca57c
Extractors for RW results and some cleanup / simplification of the C-…
aschaffer 2626bf0
C-API RW extractors.
aschaffer f10ea06
C-API RW test checking functionality.
aschaffer 1e3d4e9
C-API RW test checking functionality simplified / more readable.
aschaffer ac9c70d
C-API RW tests. Resources management: handle and device_buffers.
aschaffer 1e17b33
Fix#1 for graph_envelope factory crash.
aschaffer f9f1006
Fixed graph_envelope creation crash.
aschaffer b8dd310
Clean-up.
aschaffer bb5be4d
Fixed some C-API inconsistencies.
aschaffer 2f5b4ee
Added a graph_envelope_t unwrapper to be called from within C++ deleg…
aschaffer a59402b
Enabled negative tests on C-API graph creation.
aschaffer b82e006
Fixed graph_envelope unpacking in C-API RW wrapper.
aschaffer a78f678
RW back to back tests.
aschaffer c64e235
Fixed one no-op test to actually test.
aschaffer 84c2377
Fixed failure handling in RW wrapper.
aschaffer bbadef7
Merge branch 'branch-21.12' of github.com:rapidsai/cugraph into fea_e…
aschaffer 91251b5
Merge remote-tracking branch 'upstream/branch-21.12' into fea_ext_bin…
rlratzel 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
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
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,43 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
// Andrei Schaffer, aschaffer@nvidia.com | ||
// | ||
// This is a collection of aggregates used by (parts of) the API defined in algorithms.hpp; | ||
// These aggregates get propagated to the C-only API (which is why they're non-template aggregates) | ||
|
||
#pragma once | ||
|
||
namespace cugraph { | ||
|
||
enum class sampling_strategy_t : int { UNIFORM = 0, BIASED, NODE2VEC }; | ||
|
||
struct sampling_params_t { | ||
sampling_params_t(void) {} | ||
|
||
sampling_params_t(int sampling_type, double p = 1.0, double q = 1.0) | ||
: sampling_type_(static_cast<sampling_strategy_t>(sampling_type)), p_(p), q_(q) | ||
{ | ||
} | ||
|
||
sampling_strategy_t sampling_type_{sampling_strategy_t::UNIFORM}; | ||
|
||
// node2vec specific: | ||
// | ||
double p_; | ||
double q_; | ||
}; | ||
} // 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
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.
So, do we plan to place bindings related files under the cugrpah/cpp directory? Or we'd better separate the core libcugraph from the bindings related files? (i.e. placing bindings related files under something like cugraph/bindings)
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.
The visitor implementation is not restricted to bindings only. It's meant to be (and it is) used for implementation purposes, too. These are cpp files. There will be a separate branch for the C-only API.
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.
Then, what about creating a separate directory under the cpp (similar to tests)? Is this directly relevant to libcugraph users? (someone willing to directly use our C++ API). If not, I am not sure it is a good idea to include this in our core libcugraph_(sg|mg).so.
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.
Yes, it is. As you probably know Visitor is useful to enrich the functionality of an object (visitee) without having to add new methods to it, which may inflate the code and cause merge conflicts on high traffic headers, like
graph*.hpp
.The visitor abstraction is being used in RW, for example, for exactly such reasons.
Also, this structuring of this code has been in place for a while. And it has been extensively discussed before-hand (at least 2 presentations and demos have been done). Constantly shuffling code around after the fact is counterproductive, confusing, and wasteful. If new code restructuring is in the works, then this is not the PR for it. This PR has different goals. We've already agreed on small, targeted PRs as opposed to all-inclusive major code restructuring ones.
There's also the question of what exactly is the criterion for code cut-off to be accepted in
cugraph
. If this is to be discussed, then, again, maybe this is something to discuss before-fact, not after. I am starting to get the feeling that it's increasingly hard to get code accepted incugraph
and a lot of effort is potentially wasted with code shuffling and reshuffling on what appears to be quite ad-hoc and last-moment criteria.