shingjan commented on a change in pull request #8820:
URL: https://github.com/apache/tvm/pull/8820#discussion_r694326004
##########
File path: python/tvm/autotvm/tuner/xgboost_cost_model.py
##########
@@ -144,6 +146,12 @@ def __init__(
self._sample_size = 0
self._reset_pool(self.space, self.target, self.task)
+ def _initializer(space, target, task):
Review comment:
I am moving this out of `XGBoostCostModel` class for a linting issue.
Right now this function would be defined at line 351.
##########
File path: python/tvm/autotvm/tuner/xgboost_cost_model.py
##########
@@ -327,14 +329,9 @@ def _get_feature(self, indexes):
if need_extract:
pool = self._get_pool()
- # If we are forking, we can pass arguments in globals for better
performance
- if multiprocessing.get_start_method(False) == "fork":
- feas = pool.map(self.feature_extract_func, need_extract)
- else:
- args = [(self.space.get(x), self.target, self.task) for x in
need_extract]
- feas = pool.map(self.feature_extract_func, args)
+ feas = pool.map_with_error_catching(self.feature_extract_func,
need_extract)
for i, fea in zip(need_extract, feas):
- fea_cache[i] = fea
+ fea_cache[i] = fea.value
Review comment:
done
--
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]