Skip to content

Commit

Permalink
Remove repeated environment variable logging
Browse files Browse the repository at this point in the history
Summary: AIT_FORCE_PROFILER_CACHE is an environment variable that should not change during AIT compilation. Log it only once instead of every profiling.

Differential Revision: D47535987

fbshipit-source-id: eba22e6044f9801064fba482789ac5911fd4c1bc
  • Loading branch information
henryhu6 authored and facebook-github-bot committed Jul 18, 2023
1 parent 737067f commit 29291ed
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 29291ed

Please sign in to comment.