Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Roadmap] Remote Backend Support and Integration 馃殌 #4806

Open
7 of 14 tasks
mananshah99 opened this issue Jun 15, 2022 · 11 comments
Open
7 of 14 tasks

[Roadmap] Remote Backend Support and Integration 馃殌 #4806

mananshah99 opened this issue Jun 15, 2022 · 11 comments

Comments

@mananshah99
Copy link
Contributor

mananshah99 commented Jun 15, 2022

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

  • Implement a concrete FeatureStore, GraphStore, and Sampler with a popular backend to provide example usage. Some thoughts here include a Ray RandomAccessDataset for a feature store and a Neo4j graph for a graph store.
  • Implement a validation class that operates on Tuple[FeatureStore, GraphStore] to perform basic sanity checks (in a similar way that Data and HeteroData do today)
  • Implement sampling from edges in the HGTSampler
  • Implement (to the extent possible) samplers in torch_geometric/loader (e.g. GraphSAINT, ShaDow) behind the sampler interface, enabling (a) easy extension to sampling from edges and (b) ease of extension to reote backedns in the future.

Code Health

  • Implement a remote backend utility class to consolidate common methods across feature and graph stores (refactor(data): simplify remote backend num_nodes computation聽#5307)
  • Consolidate conditionals for Data, HeteroData, and Tuple[FeatureStore, GraphStore] throughout the PyG codebase into a single conditional. This should be possible since both Data and HeteroData are FeatureStore and GraphStores
@mananshah99 mananshah99 self-assigned this Jun 15, 2022
@rusty1s rusty1s changed the title [Roadmap] Feature Store Integration [Roadmap] Feature Store Integration 馃殌 Jun 15, 2022
@rusty1s rusty1s changed the title [Roadmap] Feature Store Integration 馃殌 [Roadmap] FeatureStore Integration 馃殌 Jun 15, 2022
@wsad1
Copy link
Member

wsad1 commented Jun 18, 2022

I think we should add this point to the roadmap

  • Implement a concrete FeatureStore using some "popular" storage backend.

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

@wsad1
Copy link
Member

wsad1 commented Jun 18, 2022

Also we could add

  • Since FeatureStore and MaterializedGraph are independent. It would be nice to have validate(FeatureStore, MaterializedGraph) which checks things like 1. MaterializedGraph only connects node_type present in FeatureStore 2. max(edge_index) is bounded by number of nodes in FeatureStore.

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

@rusty1s
Copy link
Member

rusty1s commented Jun 19, 2022

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
Copy link
Member

rusty1s commented Jun 19, 2022

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

@mananshah99
Copy link
Contributor Author

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

@mananshah99 mananshah99 changed the title [Roadmap] FeatureStore Integration 馃殌 [Roadmap] FeatureStore and GraphStore Integration 馃殌 Jun 28, 2022
@Padarn
Copy link
Contributor

Padarn commented Jul 3, 2022

@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
Copy link
Contributor

Padarn commented Jul 3, 2022

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

@rusty1s rusty1s added roadmap and removed feature labels Aug 8, 2022
@mananshah99 mananshah99 changed the title [Roadmap] FeatureStore and GraphStore Integration 馃殌 [Roadmap] Remote Backend Support and Integration 馃殌 Sep 20, 2022
@mananshah99
Copy link
Contributor Author

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!

@ivaylobah ivaylobah pinned this issue Sep 26, 2022
@ray6080 ray6080 mentioned this issue Feb 14, 2023
13 tasks
@rusty1s rusty1s unpinned this issue Jun 23, 2023
@Derek-Wds
Copy link

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
Copy link
Member

rusty1s commented Aug 30, 2023

cc @mananshah99

@AlexMRuch
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants