You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/05/27 17:33:42 UTC

[GitHub] [tvm] mbs-octoml commented on a diff in pull request #11432: [Relay] Plumb external codegen target via Target.current()

mbs-octoml commented on code in PR #11432:
URL: https://github.com/apache/tvm/pull/11432#discussion_r883821702


##########
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.
+@pytest.mark.parametrize("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:
   Good point, I wrote a 'proper' comment on the RelayToTIRTargetHook decl.
   
   At some point we should  rename that PreLoweringTargetHooks or similar since the 'ToTIR' part is too specific.



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org