Get entire graph in C/LLVM output (not only lib)



I am using TVM to obtain either C or LLVM code. In any case, the suggested way (here and in the tutorials) is something like

graph, lib, params =
        mod, target, params=params)


This however produces source code for single functions. As I understand, graph contains the information about how they are connected to each other. Is there any way of merging the two types of information, i.e. the implementation of functions from lib and the way they are used from graph?


I used a hack in the tvm code to find the lower ‘c’ or ‘llvm’ code :

In this example code :

Make the following changes :

sg = topi.generic.schedule_reduce(g) print(tvm.lower(sg, [a, b], simple_mode=True))


thank you for your answer. Can you expand a bit what the different parameters are?
I am not working on CUDA (but changing the target should not be too difficult), g should be graph in my example? And what about [a,b]?