From 1c4cdfd9507b33057edbaeca28c15c6b92abc620 Mon Sep 17 00:00:00 2001 From: Gavin Uberti Date: Wed, 14 Dec 2022 15:03:06 -0800 Subject: [PATCH] Get Relay tutorials working with Colab --- gallery/how_to/work_with_relay/build_gcn.py | 9 +++++++++ gallery/how_to/work_with_relay/using_external_lib.py | 8 +++++++- .../how_to/work_with_relay/using_pipeline_executor.py | 6 ++++++ gallery/how_to/work_with_relay/using_relay_viz.py | 6 ++++++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/gallery/how_to/work_with_relay/build_gcn.py b/gallery/how_to/work_with_relay/build_gcn.py index 8953ffc2e474c..b9adccd7c420b 100644 --- a/gallery/how_to/work_with_relay/build_gcn.py +++ b/gallery/how_to/work_with_relay/build_gcn.py @@ -25,6 +25,15 @@ Cora dataset is a common benchmark for Graph Neural Networks (GNN) and frameworks that support GNN training and inference. We directly load the dataset from DGL library to do the apples to apples comparison against DGL. +To start, we'll install Apache TVM, DGL, and PyTorch using Pip: + +.. code-block:: bash + + %%shell + pip install apache-tvm + pip install torch==1.9.0 + pip install dgl==v0.7.2 -f https://data.dgl.ai/wheels/repo.html + Please refer to DGL doc for DGL installation at https://docs.dgl.ai/install/index.html. diff --git a/gallery/how_to/work_with_relay/using_external_lib.py b/gallery/how_to/work_with_relay/using_external_lib.py index c018ee13c724e..87f2966a25d8d 100644 --- a/gallery/how_to/work_with_relay/using_external_lib.py +++ b/gallery/how_to/work_with_relay/using_external_lib.py @@ -29,7 +29,13 @@ Before we can use external libraries from Relay, your TVM needs to be built with libraries you want to use. For example, to use cuDNN, USE_CUDNN option in `cmake/config.cmake` needs to be enabled, and cuDNN include and library directories need to be specified if necessary. -To begin with, we import Relay and TVM. +To start, we'll install Apache TVM and import it: + +.. code-block:: bash + + %%shell + pip install apache-tvm + """ # sphinx_gallery_start_ignore diff --git a/gallery/how_to/work_with_relay/using_pipeline_executor.py b/gallery/how_to/work_with_relay/using_pipeline_executor.py index 87516d656d703..4a825ea8e32a0 100755 --- a/gallery/how_to/work_with_relay/using_pipeline_executor.py +++ b/gallery/how_to/work_with_relay/using_pipeline_executor.py @@ -20,6 +20,12 @@ **Author**: `Hua Jiang `_ This is a short tutorial on how to use "Pipeline Executor" with Relay. + +.. code-block:: bash + + %%shell + pip install apache-tvm + """ import tvm from tvm import te diff --git a/gallery/how_to/work_with_relay/using_relay_viz.py b/gallery/how_to/work_with_relay/using_relay_viz.py index 2e68ce902899c..7a1fd22589606 100644 --- a/gallery/how_to/work_with_relay/using_relay_viz.py +++ b/gallery/how_to/work_with_relay/using_relay_viz.py @@ -34,6 +34,12 @@ We will introduce how to implement customized parsers and renderers through interface classes. For more details, please refer to :py:mod:`tvm.contrib.relay_viz`. + +.. code-block:: bash + + %%shell + pip install apache-tvm + """ # sphinx_gallery_start_ignore