masahi commented on a change in pull request #10578:
URL: https://github.com/apache/tvm/pull/10578#discussion_r826555474



##########
File path: python/tvm/meta_schedule/integration.py
##########
@@ -230,45 +213,32 @@ def extract_task_from_relay(
         The tasks extracted from this network
     """
 
-    @contextmanager
-    def _autotvm_silencer():
-        from tvm import autotvm  # pylint: disable=import-outside-toplevel
-
-        silent = autotvm.GLOBAL_SCOPE.silent
-        autotvm.GLOBAL_SCOPE.silent = True
-        try:
-            yield
-        finally:
-            autotvm.GLOBAL_SCOPE.silent = silent
+    extract_task_func = 
get_global_func("relay.backend.MetaScheduleExtractTask")
+    assert extract_task_func
 
-    def _thread_run(func: Callable[[], None]) -> None:
-        import threading  # pylint: disable=import-outside-toplevel
+    target = Target(target) if isinstance(target, str) else target
 
-        thread = threading.Thread(target=func)
-        thread.start()
-        thread.join()
+    relay_params = {}
+    for name, param in params.items():
+        if isinstance(param, np.ndarray):
+            param = nd.array(param)
+        relay_params[name] = const(param)

Review comment:
       Initially I was strictly following what `VMCompiler.lower()` based task 
extraction does. This was copied from 
https://github.com/apache/tvm/blob/137def8bf211ccad165349d9f4ba7d20f3a7164e/python/tvm/relay/backend/vm.py#L109
   
   But yeah, this is not necessary at all. I changed the interface of 
`ExtractTask` to take in `NDArray` directly, rather than `Constant`.




-- 
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