arina-grovety commented on code in PR #13212:
URL: https://github.com/apache/tvm/pull/13212#discussion_r1089071751
##########
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:
Hello @ashutosh-arm,
sorry, there is a non-fixed comment,
now we pass the initial Relay as Relay IR itself, and then use "annotate"
parameter of the
[astext()](https://github.com/apache/tvm/pull/13212/files#diff-5c75738c5cc53888ceb0c8b4833a013631295fb70b2a3a1178f8523271052671R536)
function
to add the desired annotations to the generated text, and then parsing our
annotations from the formed text.
I will fix the comment string in the update to the PR.
--
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]