Skip to content

Commit

Permalink
Remove repeated environment variable logging (#833)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
henryhu6 authored and facebook-github-bot committed Jul 20, 2023
1 parent 2519f8e commit 66d4fe5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions python/aitemplate/compiler/transform/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
gemm,
GemmProfilerPostprocessingDelegate,
)
from aitemplate.utils.environ import force_profiler_cache

# pylint: disable=C0103,W0613,W0102

Expand Down Expand Up @@ -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)
)
Expand Down
1 change: 0 additions & 1 deletion python/aitemplate/utils/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 66d4fe5

Please sign in to comment.