jwfromm commented on code in PR #11432:
URL: https://github.com/apache/tvm/pull/11432#discussion_r883153138
##########
tests/python/relay/test_target_hooks.py:
##########
@@ -50,6 +56,49 @@ def test_tir_external_generation(check_result):
check_result(func, inputs, (8,), x_data - y_data)
+# TODO(mbs): The check_aot_executor_result does not support list-of-targets,
mostly because
+# tvm.testing.aot.compile_and_run requires the target to be a kind name
string, and
+# tvm.testing.aot.compile_models requires a single Target object. However,
code outside of
+# tvm.testing.aot is ready for this more general form.
[email protected]("check_result", [check_graph_executor_result,
check_vm_result])
+def test_tir_external_generation_outline_with_target_instance(check_result):
+ shape = (8,)
+ x_data = np.random.randint(255, size=shape).astype("float32")
+ y_data = np.random.randint(255, size=shape).astype("float32")
+ inputs = {"x": x_data, "y": y_data}
+ # Compile with an instance of the hooked target kind to demonstrate
plumbing target attributes
+ # into custom passes.
Review Comment:
I think a pointer to `example_target_hooks` here would be really useful for
helping readers discover the big picture to how this works. Otherwise the below
snippet compiling appears very magical.
--
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]