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

Update Labor sampler docs, add NeurIPS acceptance #6369

Merged
merged 4 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/dgl/dataloading/labor_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

class LaborSampler(BlockSampler):
"""Sampler that builds computational dependency of node representations via
labor sampling for multilayer GNN from
`(LA)yer-neigh(BOR) Sampling: Defusing Neighborhood Explosion in GNNs
labor sampling for multilayer GNN from the NeurIPS 2023 paper
`Layer-Neighbor Sampling -- Defusing Neighborhood Explosion in GNNs
<https://arxiv.org/abs/2210.13339>`__
mfbalin marked this conversation as resolved.
Show resolved Hide resolved

This sampler will make every node gather messages from a fixed number of
Expand Down
5 changes: 3 additions & 2 deletions python/dgl/graphbolt/impl/csc_sampling_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,9 @@ def sample_layer_neighbors(
probs_name: Optional[str] = None,
) -> SampledSubgraphImpl:
"""Sample neighboring edges of the given nodes and return the induced
subgraph via layer-neighbor sampling from arXiv:2210.13339:
"Layer-Neighbor Sampling -- Defusing Neighborhood Explosion in GNNs"
subgraph via layer-neighbor sampling from the NeurIPS 2023 paper
`Layer-Neighbor Sampling -- Defusing Neighborhood Explosion in GNNs
<https://arxiv.org/abs/2210.13339>`__

Parameters
----------
Expand Down
16 changes: 12 additions & 4 deletions python/dgl/graphbolt/impl/neighbor_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ def _sample_subgraphs(self, seeds):
@functional_datapipe("sample_layer_neighbor")
class LayerNeighborSampler(NeighborSampler):
"""
Sampler that builds computational dependency of node representations via
labor sampling for multilayer GNN from the NeurIPS 2023 paper
`Layer-Neighbor Sampling -- Defusing Neighborhood Explosion in GNNs
<https://arxiv.org/abs/2210.13339>`__

Layer-Neighbor sampler is responsible for sampling a subgraph from given
data. It returns an induced subgraph along with compacted information. In
the context of a node classification task, the neighbor sampler directly
Expand All @@ -131,10 +136,13 @@ class LayerNeighborSampler(NeighborSampler):
positive and negative node pairs, and employs these nodes as the seed nodes
for subsequent steps.

Implements the approach described in https://arxiv.org/abs/2210.13339,
Appendix A.3. Similar to dgl.dataloading.LaborSampler but this uses
sequential poisson sampling instead of poisson sampling to keep the count
of sampled edges per vertex deterministic.
Implements the approach described in Appendix A.3 of the paper. Similar to
dgl.dataloading.LaborSampler but this uses sequential poisson sampling
instead of poisson sampling to keep the count of sampled edges per vertex
deterministic like NeighborSampler. Thus, it is a drop-in replacement for
NeighborSampler. However, unlike NeighborSampler, it samples fewer vertices
and edges for multilayer GNN scenario without harming convergence speed with
respect to training iterations.
"""

def __init__(
Expand Down
6 changes: 3 additions & 3 deletions python/dgl/sampling/labor.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def sample_labors(
output_device=None,
):
"""Sampler that builds computational dependency of node representations via
labor sampling for multilayer GNN from
`(LA)yer-neigh(BOR) Sampling: Defusing Neighborhood Explosion in GNNs
<https://arxiv.org/abs/2210.13339>`
labor sampling for multilayer GNN from the NeurIPS 2023 paper
`Layer-Neighbor Sampling -- Defusing Neighborhood Explosion in GNNs
<https://arxiv.org/abs/2210.13339>`__

This sampler will make every node gather messages from a fixed number of neighbors
per edge type. The neighbors are picked uniformly with default parameters. For every vertex t
Expand Down