You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by tq...@apache.org on 2023/05/03 13:55:52 UTC

[tvm] branch unity updated: [Unity] Limit number of characters in logger names (#14752)

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

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


The following commit(s) were added to refs/heads/unity by this push:
     new a0e0f275ab [Unity] Limit number of characters in logger names (#14752)
a0e0f275ab is described below

commit a0e0f275ab008a1865942b7c3c9b224c5b987395
Author: Josh Fromm <jw...@octoml.ai>
AuthorDate: Wed May 3 06:55:43 2023 -0700

    [Unity] Limit number of characters in logger names (#14752)
    
    Small change to limit the name size of loggers created during tuning
---
 python/tvm/meta_schedule/logging.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/python/tvm/meta_schedule/logging.py b/python/tvm/meta_schedule/logging.py
index 53353e3aa9..835c28462b 100644
--- a/python/tvm/meta_schedule/logging.py
+++ b/python/tvm/meta_schedule/logging.py
@@ -255,7 +255,8 @@ def get_loggers_from_work_dir(
     log_dir = osp.join(work_dir, "logs")
     os.makedirs(log_dir, exist_ok=True)
     pattern = __name__ + ".task_{i:0" + f"{len(str(len(task_names) - 1))}" + "d}_{name}"
-    loggers = [pattern.format(i=i, name=name) for i, name in enumerate(task_names)]
+    # Very long names may need be clipped to prevent os errors, we use the first 100 characters.
+    loggers = [pattern.format(i=i, name=name[:100]) for i, name in enumerate(task_names)]
     create_loggers(
         log_dir=log_dir,
         params=[{"log_dir": log_dir, "logger_name": logger} for logger in loggers],