dgl.graphbolt.rst 3.5 KB
Newer Older
1
2
3
4
5
6
7
.. _apibackend:

🆕 dgl.graphbolt
=================================

.. currentmodule:: dgl.graphbolt

Rhett Ying's avatar
Rhett Ying committed
8
9
**dgl.graphbolt** is a dataloading framework for GNN that provides well-defined
APIs for each stage of the data pipeline and multiple standard implementations.
10

Rhett Ying's avatar
Rhett Ying committed
11
12
13
14
Dataset
-------

A dataset is a collection of graph structure data, feature data and tasks.
15
16
17
18

.. autosummary::
    :toctree: ../../generated/
    :nosignatures:
19
    :template: graphbolt_classtemplate.rst
20
21

    Dataset
Rhett Ying's avatar
Rhett Ying committed
22
23
24
    OnDiskDataset
    BuiltinDataset
    LegacyDataset
25
    Task
Rhett Ying's avatar
Rhett Ying committed
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

Graph
-----

A graph is a collection of nodes and edges. It can be a homogeneous graph or a
heterogeneous graph.

.. autosummary::
    :toctree: ../../generated/
    :nosignatures:
    :template: graphbolt_classtemplate.rst

    SamplingGraph
    FusedCSCSamplingGraph


Feature and FeatureStore
------------------------

A feature is a collection of data(tensor, array). A feature store is a
collection of features.

.. autosummary::
    :toctree: ../../generated/
    :nosignatures:
    :template: graphbolt_classtemplate.rst

    Feature
    FeatureStore
    BasicFeatureStore
    TorchBasedFeature
    TorchBasedFeatureStore
    GPUCachedFeature


DataLoader
----------

A dataloader is for iterating over a dataset and generate mini-batches.

.. autosummary::
    :toctree: ../../generated/
    :nosignatures:
    :template: graphbolt_classtemplate.rst

    DataLoader


ItemSet
-------

An item set is a iterable collection of items.

.. autosummary::
    :toctree: ../../generated/
    :nosignatures:
    :template: graphbolt_classtemplate.rst

84
85
    ItemSet
    ItemSetDict
Rhett Ying's avatar
Rhett Ying committed
86
87
88
89
90
91
92
93
94
95
96
97


ItemSampler
-----------

An item sampler is for sampling items from an item set.

.. autosummary::
    :toctree: ../../generated/
    :nosignatures:
    :template: graphbolt_classtemplate.rst

98
    ItemSampler
99
    DistributedItemSampler
Rhett Ying's avatar
Rhett Ying committed
100
101
102
103
104
105
106
107
108
109
110
111
112


MiniBatch
---------

A mini-batch is a collection of sampled subgraphs and their corresponding
features. It is the basic unit for training a GNN model.

.. autosummary::
    :toctree: ../../generated/
    :nosignatures:
    :template: graphbolt_classtemplate.rst

113
    MiniBatch
114

115

Rhett Ying's avatar
Rhett Ying committed
116
117
118
119
NegativeSampler
---------------

A negative sampler is for sampling negative items from mini-batches.
120
121
122
123

.. autosummary::
    :toctree: ../../generated/
    :nosignatures:
124
    :template: graphbolt_classtemplate.rst
125

Rhett Ying's avatar
Rhett Ying committed
126
127
    MiniBatchTransformer
    NegativeSampler
128
    UniformNegativeSampler
Rhett Ying's avatar
Rhett Ying committed
129
130
131
132
133
134
135
136
137
138
139
140
141
142


SubgraphSampler
---------------

A subgraph sampler is for sampling subgraphs from a graph.

.. autosummary::
    :toctree: ../../generated/
    :nosignatures:
    :template: graphbolt_classtemplate.rst

    SubgraphSampler
    SampledSubgraph
143
144
    NeighborSampler
    LayerNeighborSampler
Rhett Ying's avatar
Rhett Ying committed
145
    SampledSubgraphImpl
146
    FusedSampledSubgraphImpl
Rhett Ying's avatar
Rhett Ying committed
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
    InSubgraphSampler


FeatureFetcher
--------------

A feature fetcher is for fetching features from a feature store.

.. autosummary::
    :toctree: ../../generated/
    :nosignatures:
    :template: graphbolt_classtemplate.rst

    FeatureFetcher


CopyTo
------

This datapipe is for copying data to a device.

.. autosummary::
    :toctree: ../../generated/
    :nosignatures:
    :template: graphbolt_classtemplate.rst

    CopyTo


Utilities
---------

.. autosummary::
    :toctree: ../../generated/
    :nosignatures:

    fused_csc_sampling_graph
    load_from_shared_memory
    from_dglgraph
    etype_str_to_tuple
    etype_tuple_to_str
    add_reverse_edges
    exclude_seed_edges
    compact_csc_format
    unique_and_compact
    unique_and_compact_csc_formats
    unique_and_compact_node_pairs