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



##########
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:
       Let's make sure the behavior is consistent in this PR.
   
   Just a nitpick, I would prefer defaulting `max_worker=None`, and do the 
checks in the function body, so that the signature could be a tiny little bit 
easier to read:
   
   ```python
   if max_workers is None:
     max_workers = os.cpu_count()
   ```




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