jtuyls commented on a change in pull request #7577:
URL: https://github.com/apache/tvm/pull/7577#discussion_r588537925
##########
File path: python/tvm/relay/op/contrib/vitis_ai.py
##########
@@ -80,25 +82,61 @@ def visit_call(self, call):
else:
return super().visit_call(call)
+ xgraph = pyxir.frontend.tvm.from_relay(mod, self.params,
postprocessing=None)
+ xgraph = pyxir.partition(xgraph, targets=[self.target])
+
+ layers = xgraph.get_layers()
+ relay_ids = [
+ list(np.array(layer.attrs["relay_id"]).flatten())
+ for layer in layers
+ if layer.target == self.target
+ ]
+ self.relay_ids = [item for sublist in relay_ids for item in sublist]
+
return Annotator().visit(func)
def annotation(mod, params, target):
- """Annotate Relay expression for Vitis-AI DPU accelerators"""
+ """Annotate Relay expression for offloading operators to Vitis AI DPU
accelerators
+ NOTE: This function does the same as the next one
(`partition_for_vitis_ai`) but is
+ still here for backward compatibility"""
Review comment:
Yes, the idea was to keep it for some time and then remove it. I will
add a deprecate warning.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]