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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Roadmap] Advanced Graph Sampling Routines 🚀 #7331

Open
13 of 17 tasks
motwaniravi12 opened this issue May 9, 2023 · 9 comments
Open
13 of 17 tasks

[Roadmap] Advanced Graph Sampling Routines 🚀 #7331

motwaniravi12 opened this issue May 9, 2023 · 9 comments

Comments

@motwaniravi12
Copy link

motwaniravi12 commented May 9, 2023

🚀 The feature, motivation and pitch

Different GNN applications require customized sampling to improve the accuracy and/or performance. We propose the following advanced sampling routines with detailed benchmarking reports.

@motwaniravi12 motwaniravi12 changed the title Advanced Graph Sampling Routines [Roadmap] Advanced Graph Sampling Routines May 9, 2023
@rusty1s rusty1s changed the title [Roadmap] Advanced Graph Sampling Routines [Roadmap] Advanced Graph Sampling Routines 🚀 May 10, 2023
@xiachenrui
Copy link

Hi, directed=False parameter in NeighborLoader() will raise 'RuntimeError: Undirected subgraphs not yet supported' yet. Will this be fixed anytime soon ?

Best,
Chen-Rui

@rusty1s
Copy link
Member

rusty1s commented May 11, 2023

Yes, this is bullet point 3 under "Subgraph sampling".

@xiachenrui
Copy link

Happy to hear this ! I can't wait to try it.

@rusty1s
Copy link
Member

rusty1s commented May 11, 2023

This routine is implemented in torch-sparse, so you can either do torch_geometric.typing.WITH_PYG_LIB=False or use the subgraph_type="bidirectional" argument in the meantime.

@xiachenrui
Copy link

xiachenrui commented May 11, 2023

OK, I notice the subgraph_type parameter is avaliable in the latest version of docments. But the latest release (2.3.1) do not include this update. I resolve this by install from github.

Thanks a lot ! @rusty1s

@mfbalin
Copy link

mfbalin commented Jul 6, 2023

Would there be any interest in a contribution of the following sampler from DGL?https://docs.dgl.ai/generated/dgl.dataloading.LaborSampler.html#dgl.dataloading.LaborSampler
It is basically a combination of Neighbor and Layer Sampling methods. DGL currently has a working CPU, GPU, and GPU over UVA implementation. Can be used as a drop-in replacement to neighbor_sample as labor_sample.

@rusty1s
Copy link
Member

rusty1s commented Jul 9, 2023

Thanks for the pointer. What would be needed to integrate this into PyG?

@mfbalin
Copy link

mfbalin commented Jul 9, 2023

I used the pcg32 random number generator as the PRNG, given random seed z and vertex id t, r_t = PRNG(z, t) in the paper. So for the CPU implementation, there will be a need for either implementing or including https://github.com/imneme/pcg-cpp as a submodule. Other fast PRNGs could also be used if they are fast at generating random numbers as a function of the random seed z and a given vertex id t.

An initial CPU contribution should be a fairly small PR.

@mfbalin
Copy link

mfbalin commented Jul 9, 2023

My PR is here: pyg-team/pyg-lib#242.

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

4 participants