gigl.distributed.dist_neighbor_sampler#

Classes#

DistNeighborSampler

GiGL's k-hop distributed neighbor sampler supporting both standard and ABLP inputs.

Module Contents#

class gigl.distributed.dist_neighbor_sampler.DistNeighborSampler(data, num_neighbors=None, with_edge=False, with_neg=False, with_weight=False, edge_dir='out', collect_features=False, channel=None, use_all2all=False, concurrency=1, device=None, seed=None)[source]#

Bases: gigl.distributed.base_sampler.BaseDistNeighborSampler

GiGL’s k-hop distributed neighbor sampler supporting both standard and ABLP inputs.

Extends BaseGiGLSampler (which provides shared input preparation utilities) and overrides _sample_from_nodes with a k-hop neighbor sampling loop.

Supports both NodeSamplerInput (standard neighbor sampling) and ABLPNodeSamplerInput (anchor-based link prediction with supervision nodes).

For ABLPNodeSamplerInput, supervision nodes (positive/negative labels) are added to the sampling seeds, and label information is included in the output metadata.

Parameters:
  • data (graphlearn_torch.distributed.dist_dataset.DistDataset)

  • num_neighbors (Optional[graphlearn_torch.typing.NumNeighbors])

  • with_edge (bool)

  • with_neg (bool)

  • with_weight (bool)

  • edge_dir (Literal['in', 'out'])

  • collect_features (bool)

  • channel (Optional[graphlearn_torch.channel.ChannelBase])

  • use_all2all (bool)

  • concurrency (int)

  • device (Optional[torch.device])

  • seed (int)