Relay currently doesn’t have an analysis pass to obtain the CallGraph which is very important for many module level analysis/optimizations, particularly for the inter-procedural optimizations such as inlining.
One of the questions I have is do we need to expose it to Python? I personally don’t want to because it is mainly used internally from C++ passes and the dependency_graph pass is also not exposed to Python frontend. If so, I will just add some gtest to it and later on I will add the inlining pass.
As a part of design principle(first class python support), it would be great if the result of the callgraph data structure can be part of the object system and exposable to py(as a result). The intermediate data structures does not have to be exposed though