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.6.0.tar.gz
.
File metadata
- Download URL: pylibcugraphops_cu12-24.6.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b7c7f52ecbe7a2ac6f170f7df37ea665a6f5532892603a7b21d7be9baba6b95 |
|
MD5 | f58588288444901934de65fd6d18b1a9 |
|
BLAKE2b-256 | df1873a21a815d04b1deb4974ccc4177699b8a2a48629676cb0fe4083a35b80b |