This is an automated email from the ASF dual-hosted git repository.

syfeng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 6c33787cd2 [MetaSchedule] Enable subprocess to stdout for DEBUG level 
(#15532)
6c33787cd2 is described below

commit 6c33787cd2c9bbe187c85606ad2bbbb404a71dc6
Author: Balint Cristian <cristian.bal...@gmail.com>
AuthorDate: Sat Aug 12 05:31:48 2023 +0300

    [MetaSchedule] Enable subprocess to stdout for DEBUG level (#15532)
---
 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 6c83545584..e47472cbe8 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 @@ class LocalRunner(PyRunner):
         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()
 

Reply via email to