tkonolige commented on a change in pull request #8492:
URL: https://github.com/apache/tvm/pull/8492#discussion_r682071759



##########
File path: python/tvm/auto_scheduler/utils.py
##########
@@ -289,41 +287,17 @@ def wrapper():
     return res[0]
 
 
-def _func_wrapper(que, func, args, kwargs, add_thread_wrapper):
-    """Call function and return the result over the queue."""
-    try:
-        if add_thread_wrapper:
-            # Add a new layer of threadinng to avoid the conflict between
-            # python's multiprocessing and tvm's thread pool.
-            res = call_func_with_thread(func, args, kwargs)
-        else:
-            res = func(*args, **kwargs)
-        que.put(res)
-    except Exception:  # pylint: disable=broad-except
-        que.put(Exception(make_traceback_info()))
-
-
-def call_func_with_timeout(timeout, func, args=(), kwargs=None, 
add_thread_wrapper=False):
+def call_func_with_timeout(
+    timeout, func, args=(), kwargs=None, add_thread_wrapper=False
+):  # pylint: disable=unused-argument

Review comment:
       Seems like we should just remove `add_thread_wrapper`.

##########
File path: python/tvm/contrib/popen_pool.py
##########
@@ -269,9 +269,14 @@ class PopenPoolExecutor:
 
     timeout : float
         Timeout value for each function submit.
+    Note
+    ----
+    If max_workers is NONE then the number returned by
+    os.cpu_count() is used. This method aligns with the
+    behavior of multiprocessing.pool().
     """
 
-    def __init__(self, max_workers, timeout=None):
+    def __init__(self, max_workers=os.cpu_count(), timeout=None):

Review comment:
       TVM has its own function to get number of threads. Should we just use 
that code instead?




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