Skip to content

Commit 6c33787

Browse files
authored
[MetaSchedule] Enable subprocess to stdout for DEBUG level (#15532)
1 parent 81fd9f3 commit 6c33787

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

python/tvm/meta_schedule/runner/local_runner.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
"""Local Runner"""
18+
import logging
1819
from contextlib import contextmanager
1920
from typing import Callable, List, Optional, Union
2021
import subprocess
@@ -273,12 +274,16 @@ def __init__(
273274
self.f_run_evaluator = f_run_evaluator
274275
self.f_cleanup = f_cleanup
275276

277+
err_path = subprocess.DEVNULL
278+
if logger.root.level <= logging.DEBUG:
279+
err_path = subprocess.STDOUT
280+
276281
logger.info("LocalRunner: max_workers = 1")
277282
self.pool = PopenPoolExecutor(
278283
max_workers=1, # one local worker
279284
timeout=timeout_sec,
280285
initializer=initializer,
281-
stderr=subprocess.DEVNULL, # suppress the stderr output
286+
stderr=err_path, # suppress the stderr output
282287
)
283288
self._sanity_check()
284289

0 commit comments

Comments
 (0)