Hello tvm community.
I am learning tvm from the tutorials and other online blogs. I learned that the compile flow in tvm is like the picture(map) below.
Then I want to use my own network model to do the whole flow one step by one step. But I noticed that most of the tutorials start from the Relay IR written by the writter, not from the network model. So I wonder how to compile one step by one step like the map shows with my onw model.
Here is what I did and what I want to do. First I built my easy pytorch model with only 1 conv+1 relu+1 MaxPool. Then I changed it into onnx form in case I can see the graph in Netron. After that, I use the code below by following the tutorials.
mod, params = relay.frontend.from_onnx(my_onnx_model, shape_dict,)
print(mod)
I thought the ‘mod’ I printed is the Relay IR. Then I noticed that in the tutorials, it just use
tvm.transform.PassContext)(opt_level=3):
lib = relay.build(mod, target=target,params=params)
dev = tvm.device(str(target,0)) # the target is ‘llvm’
module=tvm.contrib.graph_executor.GraphModule(lib"default")
Therefore I can’t see the other IR forms of my network model. I wonder how I can see them, and whether I can optimize the model like using fusion or other ways. Thank you!