Graph Store – Graph for multi-processing and distributed training¶
Shared-memory DGLGraph.
This is a client to access data in the shared-memory graph store that has loads the graph structure and node embeddings and edge embeddings to shared memory. It provides the DGLGraph interface.
- Parameters
graph_name (string) – Define the name of the graph.
port (int) – The port that the server listens to.
Querying the distributed setting¶
The number of workers using the graph store. |
|
The id of the current worker using the graph store. |
|
Destroy the graph store. |
Using Node/edge features¶
|
Create node embedding. |
|
Create edge embedding. |
Computing with Graph store¶
|
Apply the function on the nodes to update their features. |
|
Apply the function on the edges to update their features. |
Group the edges by nodes and apply the function on the grouped edges to |
|
|
Receive and reduce incoming messages and update the features of node(s) \(v\). |
|
Send messages along edges and let destinations receive them. |
|
Pull messages from the node(s)’ predecessors and then update their features. |
|
Send message from the node(s) to their successors and update them. |
Distribute the computation in update_all among all pre-defined workers. |
Construct a graph store¶
-
dgl.contrib.graph_store.
create_graph_store_server
(graph_data, graph_name, store_type, num_workers, multigraph=None, port=8000)[source]¶ Create the graph store server.
The server loads graph structure and node embeddings and edge embeddings.
Currently, only shared-memory graph store server is supported, so store_type can only be “shared_mem”.
After the server runs, the graph store clients can access the graph data with the specified graph name.
DGL graph accepts graph data of multiple formats:
NetworkX graph,
scipy matrix,
DGLGraph.
If the input graph data is DGLGraph, the constructed DGLGraph only contains its graph index.
- Parameters
graph_data (graph data) – Data to initialize graph.
graph_name (string) – Define the name of the graph.
store_type (string) – The type of the graph store. The current option is “shared_mem”.
num_workers (int) – The number of workers that will connect to the server.
multigraph (bool, optional) – Deprecated (Will be deleted in the future). Whether the graph would be a multigraph (default: True)
port (int) – The port that the server listens to.
- Returns
The graph store server
- Return type
SharedMemoryStoreServer
-
dgl.contrib.graph_store.
create_graph_from_store
(graph_name, store_type, port=8000)[source]¶ Create a client from the graph store.
The client constructs the graph structure and node embeddings and edge embeddings that has been loaded by the graph store server.
Currently, only shared-memory graph store server is supported, so store_type can only be “shared_memory”.
- Parameters
graph_name (string) – Define the name of the graph.
store_type (string) – The type of the graph store. The current option is “shared_mem”.
port (int) – The port that the server listens to.
- Returns
The shared-memory DGLGraph
- Return type