lhutton1 commented on code in PR #13212:
URL: https://github.com/apache/tvm/pull/13212#discussion_r1145954131


##########
python/tvm/driver/tvmc/compiler.py:
##########
@@ -459,3 +493,65 @@ def save_dumps(module_name: str, dumps: Dict[str, str], 
dump_root: str = "."):
         dump_name = module_name + "." + dump_format
         with open(Path(dump_root, dump_name), "w") as f:
             f.write(dumps[dump_format])
+
+
+def dump_operation_offloads(mod: tvm.ir.IRModule, initial_relay_astext: list, 
dump_path: str):
+    """This helper function forms a line-by-line output of the initial Relay 
lines,
+    indicating which operations are ported to which backend,
+    indicating the composite that includes those operations e.g
+    'device1    <- device2.qnn_conv2d'
+    'device1    <-        %0 = qnn.conv2d(%tfl.quantize, %v_param_1, ...'
+    'device1    <-        %1 = nn.bias_add(%0, %v_param_2, axis=3);'
+    'device1    <-        %2 = qnn.requantize(%1, meta[relay.Constant]...'
+    'device2    <- device2.reshape'
+    'device2    <-        %3 = reshape(%206, newshape=[1, 1001]);'
+
+    Parameters
+    ----------
+    mod : tvm.ir.IRModule
+        The IRModule that gets generated from a relay frontend.
+    initial_relay_astext : list

Review Comment:
   Apologies if there might have been some confusion here, this question was 
more around the need to search over the relay IR as text for the compiler name, 
op name, func id, etc. The information could be extracted using a visitor pass 
(`ExprVisitor`) that traverses the IR, making it more resilient to changes in 
the text format of the IR. Since this method is working and to move this 
forwards, we can pull this out into a separate follow-up



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to