Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AUTOTVM][DOCS] Add a link to the defining network description of auto-tuning tutorial #4023

Merged
merged 2 commits into from
Sep 29, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tutorials/autotvm/tune_relay_x86.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
# <https://docs.tvm.ai/tutorials/frontend/build_gcn.html#building-a-graph-convolutional-network>`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use internal restructured text anchors for refering to something inside the doc

#
# 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)
Expand Down Expand Up @@ -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".
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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):
Expand Down