Refine Relay with AutoTVM tutorial

The turotial for Relay deployment with AutoTVM is unclear in terms of the practical use case of AutoTVM. Issue #3970 illustrates this problem, and I personally have a similar experience. We should refine this tutorial by not using a predefined network so that it could be closer to most user cases.

@kevinthesun do you have any suggestions?

What do you think is missing in those tutorials?

According to the issue I specified above and my experience, I think it is unclear about how to create a Relay module. For example, the tutorial uses a simple API to get the Relay module:

mod, params = relay.testing.resnet.get_workload(num_layers=n_layer, batch_size=batch_size, dtype=dtype)

On the other hand, if users want to build their own network, they may need to write the code like follows:

out1 = relay.nn.conv2d(...)
out2 = relay.nn.dense(out1, ...)
mod = relay.Module.from_expr(out2)
mod = relay.transform.InferType()(mod)

Note that this may not the only way to create a module, so I would suggest having a tutorial about this part. It may not necessary to be in the Relay with AutoTVM tutorial since this tutorial is supposed to focus on tuning. Maybe we could add it here or even make a new one talking about how to build a Relay module from scratch and make a reference link?

1 Like

I think we can add a link to relay.testing.resnet to direct the details of building NN with relay.

Good point! Then a simple PR of adding a line would be sufficient.

Hi @kevinthesun

Are you saying that we can add this link to following tutorials?

  1. Quick Start Tutorial for Compiling Deep Learning Models
  2. Auto-tuning a convolutional network for ARM CPU
  3. Auto-tuning a convolutional network for Mobile GPU
  4. Auto-tuning a convolutional network for NVIDIA GPU
  5. Auto-tuning a convolutional network for x86 CPU

No. I meant add a link to relay.testing.resnet function in quick start tutorial.

Hi @kevinthesun

Okay, I will enhance the quick start tutorial ASAP.