Skip to content

Commit

Permalink
Add CLI Notebook examples in the doc (#1087)
Browse files Browse the repository at this point in the history
*Issue #, if available:*

*Description of changes:*


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

---------

Co-authored-by: Xiang Song <[email protected]>
  • Loading branch information
classicsong and Xiang Song authored Nov 11, 2024
1 parent 19fac3b commit 3a21067
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
"id": "a0c7764a",
"metadata": {},
"source": [
"### 0. Setup environment\n",
"----\n",
"## 0. Setup environment\n",
"First let's install GraphStorm and its dependencies, PyTorch and DGL."
]
},
Expand All @@ -63,8 +62,7 @@
"id": "76f8f9c9",
"metadata": {},
"source": [
"### 1. Create the example ACM graph data\n",
"---\n",
"## 1. Create the example ACM graph data\n",
"This notebook uses the ACM graph as an example. We use the following script to create the ACM graph data."
]
},
Expand Down Expand Up @@ -103,8 +101,7 @@
"id": "ee3ca793",
"metadata": {},
"source": [
"### 2. Construct and Partition ACM Graph\n",
"---\n",
"## 2. Construct and Partition ACM Graph\n",
"Since GraphStorm is designed naturally for distributed GNN training, we need to construct a graph and split it into multiple partitions. In this example, for simplicity, we create a graph with one partition (no actual splitting)."
]
},
Expand Down Expand Up @@ -135,9 +132,7 @@
"id": "5735fdf1",
"metadata": {},
"source": [
"### 3. GNN Model Training \n",
"---\n",
"\n",
"## 3. GNN Model Training \n",
"Once the graph constucted, we can call the GraphStorm multi-task learning CLI to run model training. Before kicking off the model training, we need to create a YAML configuration file for the CLI."
]
},
Expand Down Expand Up @@ -219,9 +214,7 @@
"id": "8b1ca0af",
"metadata": {},
"source": [
"### 4. GNN Model Inference \n",
"---\n",
"\n",
"## 4. GNN Model Inference \n",
"Once the model is trained, we can do model inference with the trained model artifacts by using the GraphStorm multi-task learning CLI. We can use the same YAML configuration file for model inference."
]
},
Expand Down
28 changes: 28 additions & 0 deletions docs/source/cli/notebooks/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.. _cli-examples:

GraphStorm CLI Examples
========================

GraphStorm provides Command Line Interfaces (CLIs) for graph data
preparation and GML model training and inference. To help users to
quickly onboard GraphStorm CLIs, we provide a set of Jupyter
notebooks as examples.

.. note:: All runnable Jupyter notebooks can be downloaded from the `GraphStorm Github repository <https://github.com/awslabs/graphstorm/tree/main/docs/source/cli/notebooks>`_.

These notebooks all use the same ACM data as discussed in
the :ref:`User Your Own Data Tutorial<use-own-data>`.
Users can follow the `Notebook 0: Data Preparation <https://github.com/awslabs/graphstorm/blob/main/docs/source/api/notebooks/Notebook_0_Data_Prepare.ipynb>`_
to explore the details of ACM data preparation.

The `CLI Notebook: Use GraphStorm CLI for Multi-task Learning <https://github.com/awslabs/graphstorm/blob/main/docs/source/cli/notebooks/Notebook_CLI_MT.ipynb>`_ provides
an example that demonstrates how to run multi-task GNN model
training and inference with GraphStorm CLIs. The training
tasks include link prediction and node feature reconstruction.

.. toctree::
:maxdepth: 2
:titlesonly:

Notebook_CLI_MT

1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Welcome to the GraphStorm Documentation and Tutorials

cli/graph-construction/index.rst
cli/model-training-inference/index.rst
cli/notebooks/index.rst

.. toctree::
:maxdepth: 2
Expand Down

0 comments on commit 3a21067

Please sign in to comment.