I am a newer to TVM, from my point, compute + schedule + auto tuning convert the relay IR to Tensor IR.
this process includes many hardware special optimizations related with schedule primitives. After the auto tuning, Tensor IR was generated.
Q1: Besides the AutoTVM(include schedules), what are the optimizations based on TIR?These optimizations are the operations in /tir/transform files?
I did not find any related knowledge about optimizations based on tir in tvm paper
Q2: whether relay.build() execute the related call below?
I’m no expert with this, but if you take a look in build_module.py, you can see what TIR passes are run after the schedules have been lowered. I’ll paste them here for convenience:
What @mbaret pointed out is correct. In addition, your figure is not exactly correct. relay.build actually goes the same flow as AutoTVM/TE schedule. When calling relay.build, it lowers each operator to TE according to Relay op strategy. The op strategy will select a TE compute/schedule for each Relay op based on certain rules. For example, if you provide the tuning logs like:
with ApplyHistoryBest('tune.log'):
relay.build(mod, target)
Then the op strategy will be based on the tuning results. On the other hand, it selects schedules based on the default priority order.