8000 Adding the best autotuner config (#146121) · pytorch/pytorch@bcd0ba0 · GitHub
[go: up one dir, main page]

Skip to content

Commit bcd0ba0

Browse files
Mingming-Dingpytorchmergebot
authored andcommitted
Adding the best autotuner config (#146121)
Summary: Adding logs to log the best config for autotune configs Test Plan: Testing in Mast : aps-omnifmv1-5_32_test_with_best_config-c5e9ceccf8 {F1974838864} Reviewed By: oulgen Differential Revision: D68931164 Pull Request resolved: #146121 Approved by: https://github.com/oulgen
1 parent 549e230 commit bcd0ba0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

torch/_inductor/runtime/triton_heuristics.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,8 +740,21 @@ def autotune_to_one_config(self, *args, **kwargs):
740740
self.autotune_time_taken_ns = (
741741
self.precompile_time_taken_ns + benchmark_time_taken_ns
742742
)
743+
744+
# log the best config
745+
launcher = self.launchers[0]
746+
log.debug(
747+
"Best config for %s: %s: %f, nreg %d, nspill %d, #shared-mem %s",
748+
self.fn.__name__,
749+
launcher.config,
750+
timings[launcher],
751+
launcher.n_regs,
752+
launcher.n_spills,
753+
launcher.shared,
754+
)
755+
743756
if self.save_cache_hook:
744-
self.save_cache_hook(self.launchers[0].config, self.autotune_time_taken_ns)
757+
self.save_cache_hook(launcher.config, self.autotune_time_taken_ns)
745758

746759
def save_gpu_kernel(self, grid, stream, launcher):
747760
if callable(grid):

0 commit comments

Comments
 (0)
0