Hi @chiuchiu,
-
In TVM, an IRModule can represent both high-level
relay.Function
and low-leveltir.PrimFunc
, as shown in the graph in the Design and Architecture. My understanding is thattvm.lower()
only does the lowering when the IRModule containstir.PrimFunc
. I think it’s worth adding comments around the API code to clarify it. -
Yes,
relay.build
transforms Relay IR to Tir IR and does the codegen. I think today it’s hard to inspect the compilation flow of each stage. There is a work in progress to replace the compile engine with TEcompiler to have an intermediate stage where Relay is lowered to TIR. I think once it’s done, it’s easier to print the content of TIR after lowering.