How to emit llvm IRs from a Relay graph module?

I compiled a Mobilenet tflite module into Relay graph_module as in the tutorial. Then I built a tvm runtime(x86 target) to run the graph. How can I continue to lower the module and get the llvm IRs ?

If you use relay.build you can obtain the LLVM IR for the operators, currently Relay is interpreted by the graph runtime for production use case scenarios. There is also a prototype type ahead of time compiler, which can produce C++ code, but it is not production ready yet.

See: https://docs.tvm.ai/tutorials/relay_quick_start.html#sphx-glr-tutorials-relay-quick-start-py

You can use the lib argument returned by build(https://docs.tvm.ai/api/python/relay/build_module.html) , you have the Module you can the methods documented here: https://docs.tvm.ai/api/python/module.html, for example get_source().

Thank you, now I get the IR for the operators.