Hello! I’m trying to figure out the problem as said in the title. For example, when a module is built like:
with autotvm.apply_graph_best(graph_opt_sch_file):
with tvm.transform.PassContext(opt_level=3):
graph_factory = relay.build_module.build(mod, target=target, params=params)
the function CallWithNewLayouts
in alter_op_layout.cc
will be called, and it calls a series of functions all the way until
@conv2d_alter_layout.register("cpu")
def _alter_conv2d_layout(attrs, inputs, tinfos, out_type):
...
supposing the target is an x86 cpu. However, I only see this function changing the layout info in attrs
, yet to see any change of the actual layout of tensors in the graph. If I debug this process and print the IR right after the AlterOpLayout
pass I can see the shapes of tensors changed accordingly from 4D to 5D/6D, and the layout_transform
nodes are inserted. So my question here is when does this happen? Can anyone give me a pointer to the code?
Many thanks!