From da45a6668a35a413e89d85d53103adcb4b89bae4 Mon Sep 17 00:00:00 2001 From: cchung100m Date: Fri, 27 Sep 2019 19:07:29 +0800 Subject: [PATCH 1/2] [AUTOTVM][DOCS] Add a link to autoTVM tutorial to direct the details of building NN with relay --- tutorials/autotvm/tune_relay_x86.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tutorials/autotvm/tune_relay_x86.py b/tutorials/autotvm/tune_relay_x86.py index 22a31b79bd0d..d31560bfb8b2 100644 --- a/tutorials/autotvm/tune_relay_x86.py +++ b/tutorials/autotvm/tune_relay_x86.py @@ -39,9 +39,12 @@ # First we need to define the network in relay frontend API. # We can load some pre-defined network from :code:`relay.testing`. # We can also load models from MXNet, ONNX and TensorFlow. +# Alternatively, we can `build a Graph Convolutional Network (GCN) with Relay +# ` # # In this tutorial, we choose resnet-18 as tuning example. + def get_network(name, batch_size): """Get the symbol definition and random weight of a network""" input_shape = (batch_size, 3, 224, 224) @@ -73,6 +76,7 @@ def get_network(name, batch_size): return mod, params, input_shape, output_shape + # Replace "llvm" with the correct target of your CPU. # For example, for AWS EC2 c5 instance with Intel Xeon # Platinum 8000 series, the target should be "llvm -mcpu=skylake-avx512". @@ -121,6 +125,7 @@ def get_network(name, batch_size): ), } + # You can skip the implementation of this function for this tutorial. def tune_kernels(tasks, measure_option, @@ -165,6 +170,7 @@ def tune_kernels(tasks, autotvm.callback.progress_bar(n_trial, prefix=prefix), autotvm.callback.log_to_file(log_filename)]) + # Use graph tuner to achieve graph level optimal schedules # Set use_DP=False if it takes too long to finish. def tune_graph(graph, dshape, records, opt_sch_file, use_DP=True): From 8e86e3305ace9c6f952691d7ed12daba22869591 Mon Sep 17 00:00:00 2001 From: cchung100m Date: Sat, 28 Sep 2019 20:18:06 +0800 Subject: [PATCH 2/2] [AUTOTVM][DOCS] Add a link to autoTVM tutorial to direct the details of building NN with relay --- tutorials/autotvm/tune_relay_x86.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tutorials/autotvm/tune_relay_x86.py b/tutorials/autotvm/tune_relay_x86.py index d31560bfb8b2..93a073170388 100644 --- a/tutorials/autotvm/tune_relay_x86.py +++ b/tutorials/autotvm/tune_relay_x86.py @@ -37,10 +37,9 @@ # Define network # -------------- # First we need to define the network in relay frontend API. -# We can load some pre-defined network from :code:`relay.testing`. +# We can either load some pre-defined network from :code:`relay.testing` +# or building :any:`relay.testing.resnet` with relay. # We can also load models from MXNet, ONNX and TensorFlow. -# Alternatively, we can `build a Graph Convolutional Network (GCN) with Relay -# ` # # In this tutorial, we choose resnet-18 as tuning example.