8000 [logs] Add autotuning data (#154771) · pytorch/pytorch@64436c3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 64436c3

Browse files
stashuk-olekpytorchmergebot
authored andcommitted
[logs] Add autotuning data (#154771)
Summary: Add autotuning logging data to scuba/chrome trace. Test Plan: ``` TORCHINDUCTOR_MAX_AUTOTUNE=1 tlp buck run //scripts/sashko:compilation_sample ``` Open https://interncache-all.fbcdn.net/manifold/perfetto-artifacts/tree/ui/index.html#!/viewer?local_cache_key=00000000-0000-0000-92db-f23383ebf5b5, search for template_autotuning, see in metadata strides (see screenshot) Differential Revision: D75457770 Pull Request resolved: #154771 Approved by: https://github.com/masnesral, https://github.com/PaulZhang12
1 parent 706bc41 commit 64436c3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

torch/_inductor/select_algorithm.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,10 +2199,21 @@ def make_benchmark_fn():
21992199

22002200
def autotune(choices):
22012201
log.debug("Starting autotuning")
2202+
2203+
autotune_data = {
2204+
"shape": ", ".join(
2205+
["x".join(map(str, n.get_size())) for n in input_nodes]
2206+
),
2207+
"strides": ", ".join([str(n.get_stride()) for n in input_nodes]),
2208+
"dtypes": ", ".join([str(n.get_dtype()) for n in input_nodes]),
2209+
"offset": ", ".join([str(n.get_layout().offset) for n in input_nodes]),
2210+
}
2211+
22022212
with dynamo_timed(
22032213
f"{name}_template_autotuning",
22042214
log_pt2_compile_event=True,
22052215
dynamo_compile_column_us="compile_time_autotune_time_us",
2216+
metadata={"autotune_data": autotune_data},
22062217
):
22072218
return make_benchmark_fn()(choices)
22082219

0 commit comments

Comments
 (0)
0