From a85cda81ed2a20937f8cf4dbf2291751a04f1771 Mon Sep 17 00:00:00 2001 From: Balint Cristian Date: Fri, 11 Aug 2023 14:04:26 +0300 Subject: [PATCH] [MetaSchedule] Enable subprocess to stdout for DEBUG level --- python/tvm/meta_schedule/runner/local_runner.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/tvm/meta_schedule/runner/local_runner.py b/python/tvm/meta_schedule/runner/local_runner.py index 6c83545584fd..e47472cbe8b7 100644 --- a/python/tvm/meta_schedule/runner/local_runner.py +++ b/python/tvm/meta_schedule/runner/local_runner.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Local Runner""" +import logging from contextlib import contextmanager from typing import Callable, List, Optional, Union import subprocess @@ -273,12 +274,16 @@ def __init__( self.f_run_evaluator = f_run_evaluator self.f_cleanup = f_cleanup + err_path = subprocess.DEVNULL + if logger.root.level <= logging.DEBUG: + err_path = subprocess.STDOUT + logger.info("LocalRunner: max_workers = 1") self.pool = PopenPoolExecutor( max_workers=1, # one local worker timeout=timeout_sec, initializer=initializer, - stderr=subprocess.DEVNULL, # suppress the stderr output + stderr=err_path, # suppress the stderr output ) self._sanity_check()