Skip to content

Commit

Permalink
[aotinductor] Only autotune at compile time when enabled via config (#…
Browse files Browse the repository at this point in the history
…129335)

Summary:
Pull Request resolved: #129335

 ---

Test Plan: ci

Reviewed By: jingsh, desertfire, houseroad

Differential Revision: D58931057
  • Loading branch information
ColinPeppler authored and facebook-github-bot committed Jun 24, 2024
1 parent 1a54bb0 commit defde8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion torch/_inductor/compile_fx.py
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ def compile_fx(
with config.patch(
{
"cpp_wrapper": False,
"triton.autotune_at_compile_time": True,
"triton.autotune_at_compile_time": config.triton.autotune_at_compile_time,
"triton.autotune_cublasLt": False,
"triton.cudagraphs": False,
"triton.store_cubin": True,
Expand Down
5 changes: 4 additions & 1 deletion torch/_inductor/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,10 @@ class triton:

# Tune the generated Triton kernels at compile time instead of first time they run
autotune_at_compile_time = (
os.environ.get("TORCHINDUCTOR_TRITON_AUTOTUNE_AT_COMPILE_TIME", "0") == "1"
os.environ.get(
"TORCHINDUCTOR_TRITON_AUTOTUNE_AT_COMPILE_TIME", "0" if is_fbcode() else "1"
)
== "1"
)

# should we stop a fusion to allow better tiling?
Expand Down

0 comments on commit defde8d

Please sign in to comment.