shingjan commented on a change in pull request #8492:
URL: https://github.com/apache/tvm/pull/8492#discussion_r672729248
##########
File path: python/tvm/auto_scheduler/utils.py
##########
@@ -306,6 +307,7 @@ def _func_wrapper(que, func, args, kwargs,
add_thread_wrapper):
def call_func_with_timeout(timeout, func, args=(), kwargs=None,
add_thread_wrapper=False):
"""Call a function with timeout"""
que = multiprocessing.Queue(2)
+ process = PopenWorker()
Review comment:
Should this multiprocessing also be changed to PopenPoolWorker? This
change is similar to #7889
##########
File path: python/tvm/auto_scheduler/utils.py
##########
@@ -306,6 +307,7 @@ def _func_wrapper(que, func, args, kwargs,
add_thread_wrapper):
def call_func_with_timeout(timeout, func, args=(), kwargs=None,
add_thread_wrapper=False):
"""Call a function with timeout"""
que = multiprocessing.Queue(2)
+ process = PopenWorker()
Review comment:
Should this multiprocessing also be changed to PopenWorker? This change
is similar to #7889
##########
File path: python/tvm/autotvm/record.py
##########
@@ -230,7 +231,7 @@ def split_workload(in_file, clean=True):
lines = list(open(in_file).readlines())
logger.info("start converting...")
- pool = multiprocessing.Pool()
+ pool = popen_pool.PopenPoolExecutor()
Review comment:
No number of threads/processes specified here.
##########
File path: python/tvm/autotvm/tuner/xgboost_cost_model.py
##########
@@ -161,7 +162,8 @@ def _reset_pool(self, space, target, task):
_extract_space = space
_extract_target = target
_extract_task = task
- self.pool = multiprocessing.Pool(self.num_threads)
+ self.pool = popen_pool.PopenPoolExecutor(self.num_threads)
Review comment:
`multiprocessing.pool()` seems to create a process pool instead of a
thread pool. Hence the name of the argument passed here `self.num_threads` may
not be the most accurate. Is that the case?
##########
File path: python/tvm/autotvm/utils.py
##########
@@ -111,7 +112,7 @@ def pool_map(func, args, batch_size, verbose=False,
pool=None):
ret = None
tic = time.time()
- local_pool = pool or multiprocessing.Pool()
+ local_pool = pool or PopenPoolExecutor()
Review comment:
same as above. No specific number of processes here. We may consider
adding a default number of process getting created in the implementation of
`PopenPoolExecutor`
--
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]