pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
21.41k stars 3.67k forks source link

[Roadmap] Remote Backend Support and Integration 🚀 #4806

Open mananshah99 opened 2 years ago

mananshah99 commented 2 years ago

Motivation

PyG currently requires users to store graphs (and associated node + edge features) in Data and HeteroData objects, which are accepted by loaders to run forward/backward passes on an accelerator of choice. This abstraction, however, does not scale to large graphs (or large feature tensors), which can quickly oversubscribe CPU DRAM (despite the GPU VRAM requirements only being the memory consumption of each sampled subgraph and its associated node and edge features). Indeed, one can imagine storing graph features (and the graph itself) in "remote backends", which provide fixed operators that can be used to integrate cleanly with downstream PyG samplers and loaders.

The goal of this roadmap is to track the integration of native remote backend support into PyG. At a high level, this will be accomplished through the feature store, graph store, and sampler abstractions into PyG. For more freeform discussion, please visit the #scalability channel in the PyG Slack community.

Implementation

Abstractions: FeatureStore, GraphStore, Sampler

Implementations

Code Health

wsad1 commented 2 years ago

I think we should add this point to the roadmap

This will help us "test" the interface, and also demonstrate how people can build concrete FeatureStores. WDYT?

wsad1 commented 2 years ago

Also we could add

Validate will mostly be a abstract class, with implementations over riding __call__(FeatureStore, MaterializedGraph).

rusty1s commented 2 years ago

Yes, @wsad1. I think these are good points. One thing we could do to showcase is to have a short example/tutorial on how to connect to a neo4j graph database or similar.

rusty1s commented 2 years ago

Can we also add some clean up tasks here? For example, relying more on FeatureStore and MaterializedGraph interfaces than BaseData.

mananshah99 commented 2 years ago

@rusty1s @wsad1 thanks for those suggestions, agreed on both fronts. Will incorporate tomorrow :)

Padarn commented 2 years ago

@mananshah99 just interested what you're planning for

Implement a concrete FeatureStore and GraphStore with a popular backend to provide example usage what backend are you thinking of supporting.

Padarn commented 2 years ago

(also I slightly updated the description to link to graphstore, hope you don't mind)

mananshah99 commented 2 years ago

Hi folks, this roadmap has been updated a bit to describe latest changes and a few potential further directions (cc @Padarn, I hope this helps address some of your questions as well). Feel free to add on, or let me know if you have any questions/comments/concerns!

Derek-Wds commented 1 year ago

Hi team, I wonder if current remote backend can support edge features. It would be great if we can access edge features such as mult-iclass labels in the remote resources such as DBs.

rusty1s commented 1 year ago

cc @mananshah99

AlexMRuch commented 10 months ago

I love seeing Ray and Neo4j on these items! 😄

Are there any updates on these items? I don't see anything listed in the repo or in the docs.

I saw an example of using Kuzu for a Remote GraphStore (via feature_store, graph_store = db.get_torch_geometric_remote_backend(mp.cpu_count())) but not anything for Neo4j (except https://neo4j.com/docs/graph-data-science-client/current/tutorials/import-sample-export-gnn/, which is more complicated than the Kuzu counterpart).

Thanks in advance!