How to get the schedule information of OPs in relay?

The tutorials provide many examples of how to load models from other frontends. But how can I look the detailed schedule for each op?

# convert models / graph into relay
mod, params = relay.frontend.from_mxnet(layer, {'data': dshape})
with relay.build_config(opt_level=3):
    graph, lib, params = relay.build(mod, target='cuda', params=params)

# how to print the schedule information use tvm.lower()?
2 Likes
  • graph: str
  • mod: tvm.relay.module.Module
  • params: dict

As TVM only takes tvm.Tensor / tvm as input, I tried to fetch the computed result

ctx = tvm.gpu()
tvm_module = tvm.contrib.graph_runtime.create(graph, lib, ctx)
tvm_module.set_input("data", dshape)
tvm_module.set_input(**params)
tvm_module.run()
tvm_output = tvm_module.get_output(0)

But the tvm_output returns type tvm.ndarray.NDArray.

You can hack into compile_engine.cc to print result of tvm.lower

1 Like

Thanks. I’ll have a look.