FeatureFetcher

class dgl.graphbolt.FeatureFetcher(datapipe, feature_store, node_feature_keys=None, edge_feature_keys=None, overlap_fetch=True, cooperative=False)[source]

Bases: MiniBatchTransformer

A feature fetcher used to fetch features for node/edge in graphbolt.

Functional name: fetch_feature.

Parameters:
  • datapipe (DataPipe) – The datapipe.

  • feature_store (FeatureStore) – A storage for features, support read and update.

  • node_feature_keys (List[str] or Dict[str, List[str]]) – Node features keys indicates the node features need to be read. - If node_features is a list: It means the graph is homogeneous graph, and the β€˜str’ inside are feature names. - If node_features is a dictionary: The keys should be node type and the values are lists of feature names.

  • edge_feature_keys (List[str] or Dict[str, List[str]]) – Edge features name indicates the edge features need to be read. - If edge_features is a list: It means the graph is homogeneous graph, and the β€˜str’ inside are feature names. - If edge_features is a dictionary: The keys are edge types, following the format β€˜str:str:str’, and the values are lists of feature names.

  • overlap_fetch (bool, optional) – If True, the feature fetcher will overlap the UVA feature fetcher operations with the rest of operations by using an alternative CUDA stream or utilizing asynchronous operations. Default is True.

  • cooperative (bool, optional) – Boolean indicating whether Cooperative Minibatching, which was initially proposed in `Deep Graph Library PR#4337<https://github.com/dmlc/dgl/pull/4337>`__ and was later first fully described in Cooperative Minibatching in Graph Neural Networks. Cooperation between the GPUs eliminates duplicate work performed across the GPUs due to the overlapping sampled k-hop neighborhoods of seed nodes when performing GNN minibatching.