Augment inlined call stack with module type/instance info.
Summary:
Motivation:
During inlinng we lose information about where the node/op is coming from in module
hierarchy. The SourceDebug info is useful in providing where in the
source code the definition of the node exist. One can follow the
callstack to find the relevant module hierarchy. However, this is less
accessible, particularly in the context of aggregating node level op
latencies to produce module level latencies. Facilitiating this
enables identifying which module might be expensive and can be
targeted either for optimization or redesign. This also aids network
architecture search approaches.
Approach:
This PR adds module type/instance information to inlined call stack
during inlining. During inlining where the subsequent CallMethods are
being replaced with their corresponding graph, we find the module
instance information corresponding to the CallMethod following the
GetAttr node that produces the module type input to CallMethod.
This approach has limitations in that such information will not be
avaiable to CallFunctions and hence we will only be able to annotate
type information and not instance information.
But the intuition is that, it should cover majority of the cases. And we
should be able to address this in another way.
Test Plan:
python test/test_jit.py TestScopeWithInlinedCallSTack
Reviewers:
Subscribers:
Tasks:
Tags: