pylibcugraphops - GPU Graph Neural Network operations
Project description
pylibcugraphops
pylibcugraphops is a wrapper around cugraph-ops and provides framework-agnostic and lightweight Python-bindings for the custom graph operators of cugraph-ops. For more information on the implemented functionality, check the corresponding documentations.
Structure
In terms of structure, the bindings somewhat follow the guidelines of cugraph-ops. The main difference is that pylibcugraphops is more focused on providing reasonable submodules and thus the overall structure is rather flat. The core functionality is placed under pylibcugraphops.operators
similar to the C++ API with the <cugraph-ops/operators>
namespace. This includes basic aggregation operators (e.g. for GraphSAGE), specialized operators (e.g. for RGCN), and operators performing pooling-like operations (e.g. readout operations aggregating from a graph-to-scalar level). While the C++ API has a further distinction into operators for message flow graphs and other kinds of graphs which can be represented through CSC, the pylibcugraphops.operators
is kept as a flat submodule with the function names making the disctiontion.
Naming Convention
The name of exposed operators and corresponding files should be self-explanatory to provide an easy overview of all relevant charateristics. Therefore, we adopt the following naming convention for operators.
<operator family>_<graph type>_<"direction">_(<operator specification>_)<[fwd|bwd|bwd_rev|...]
Examples
agg_simple_csc_bwd
pool_csc_n2s_bwd
agg_hg_basis_mfg_n2n_post_bwd
Support for different datatypes is achieved through overloading and thus usually not explicitly part of operator names.
Explanation of Individual Parts
<operator family>
denotes the underlying operator, we currently haveagg_simple
: basic aggregator performing a mean/sum/min/max reduction of the specified setagg_concat
: likeagg_simple
but additionally concatenates the self representation of each set memberagg_dmpnn
: implmements the DMPNN edge-to-edge aggregationpool
: sum/mean/min/max pooling, e.g. node-to-scalar readouthg_basis
: heterogenous aggregation using different edge types and potentially using a basis decompositionmha_gat
: multi-headed attention aggregation, in this case GAT as specific variant
<graph type>
which graph type the operator is intended forcsc
: simple csc representation of a graphbipartite
: simple csc representation of a bipartite graphmfg
: message flow graph
<"direction">
: for easier overview of which operators we already have, multiple directions are combined and separated through underscores (e.g.e2n_n2n
)n2n
: node-to-node (basic aggregation)e2n
: edge-to-nodee2e
: edge-to-edgen2s
: node-to-scalar
<operator specification>
: some operators define different kinds of "flavors", e.g. the "pre" and the "post" variant of thehg_basis
operators
Function Signatures
The following pattern should be used
func(output_vector_arg_0, ..., output_vector_arg_n,
input_vector_arg_0, ..., input_vector_arg_n,
graph_structure_arg_0, ..., graph_structure_arg_n,
*args,
**kwargs,
cuda_stream=None)
*args
: arguments necessary forfunc
but neither a buffer nor a graph structure**kwargs
: optional arguments or arguments with default valuescuda_stream
should be the last argument in a binding if applicable and defaulted to the null stream
Example for RGCN (hg_basis_pre):
def agg_hg_basis_mfg_n2n_pre_bwd(output_gradient,
input_gradient,
input_embedding,
message_flow_graph_hg_csc_int32 graph,
output_weight_gradient=None,
weights_combination=None,
concat_own=False,
norm_by_degree=False,
cuda_stream=None):
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pylibcugraphops_cu12-24.4.0.tar.gz
.
File metadata
- Download URL: pylibcugraphops_cu12-24.4.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/43.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.2.1 tqdm/4.66.2 importlib-metadata/7.0.2 keyring/24.3.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69c3bda50767f2a93d186e2d7f39f30faa92d154310e357eba6f433616d3c19f |
|
MD5 | cec1421376e38f91f4a3de3d376b9d27 |
|
BLAKE2b-256 | 02de64acb17d43daf592012c167dc37067ab3b0e8eac899c65931eb375938908 |