Print method for Module (graph runtime)?

As far as I understood reading threads on this forum, there is no easy way to obtain a single file containing the complete LLVM IR of a compiled module: we have to keep the three items (graph, lib and params) as they are and let TVMRuntime handle them.

This is not a viable solution in my case: I would like to be able to use TVM to compile and optimize ONNX models, and then extract an LLVM IR that will be further processed by other tools. Manually connecting each function in the compiled library is difficult even if there are only two or three of them, a complete neural network would be unmanageable.

Do you think it could be feasible to write some code to “print” the module structure built by graph_runtime.create? Where could I start? I am not even sure where the Module class is defined.

2 Likes

Excuse me if I disturbed, but I am encountered the same problem since I also want to obtained one single executable file from those three items. Have you managed to get over such situation?