From 66d4fe502e97c418cd256d19f7f5af0968a27a03 Mon Sep 17 00:00:00 2001 From: Henry Hu Date: Wed, 19 Jul 2023 17:53:06 -0700 Subject: [PATCH] Remove repeated environment variable logging (#833) Summary: Pull Request resolved: https://github.com/facebookincubator/AITemplate/pull/833 AIT_FORCE_PROFILER_CACHE is an environment variable that should not change during AIT compilation. Log it only once instead of every profiling. Reviewed By: frank-wei, chenyang78 Differential Revision: D47535987 fbshipit-source-id: 654a701e14d23b1957013d8464a2bedabe5f54fd --- python/aitemplate/compiler/transform/profile.py | 2 ++ python/aitemplate/utils/environ.py | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/python/aitemplate/compiler/transform/profile.py b/python/aitemplate/compiler/transform/profile.py index ff3083d4c..01b91f591 100644 --- a/python/aitemplate/compiler/transform/profile.py +++ b/python/aitemplate/compiler/transform/profile.py @@ -31,6 +31,7 @@ gemm, GemmProfilerPostprocessingDelegate, ) +from aitemplate.utils.environ import force_profiler_cache # pylint: disable=C0103,W0613,W0102 @@ -78,6 +79,7 @@ def profile( devices = [0] profiler_dir = os.path.join(workdir) start_t = datetime.now() + _LOGGER.info(f"Force profiler cache = {force_profiler_cache()}") generated_profilers = list( codegen.gen_profiler(sorted_graph, profiler_dir, dynamic_profiling_strategy) ) diff --git a/python/aitemplate/utils/environ.py b/python/aitemplate/utils/environ.py index ddc00c852..160b56a1e 100644 --- a/python/aitemplate/utils/environ.py +++ b/python/aitemplate/utils/environ.py @@ -66,7 +66,6 @@ def force_profiler_cache() -> bool: assert ( os.environ.get("FORCE_PROFILE", None) != "1" ), "cannot specify both AIT_FORCE_PROFILER_CACHE and FORCE_PROFILE" - _LOGGER.info(f"{force_cache=}") return force_cache