Skip to content

Commit c1f8e99

Browse files
committed
Lint.
(cherry picked from commit dd990a3) (cherry picked from commit 0de435f)
1 parent 26f8133 commit c1f8e99

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

torch/_inductor/runtime/triton_heuristics.py

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1914,25 +1914,24 @@ def pointwise(
19141914
size_hints, TRITON_MAX_BLOCK["X"], waves_per_eu=2
19151915
),
19161916
triton_config_with_settings(
1917-
size_hints, 4096 # wrt: better than the max_block for some kernel
1917+
size_hints,
1918+
4096, # wrt: better than the max_block for some kernel
19181919
),
19191920
*hinted_configs,
19201921
]
19211922
# Additional reduction configs appended for ROCm builds
19221923
if torch.version.hip:
1923-
configs.append(triton_config_with_settings(
1924-
size_hints,
1925-
2048,
1926-
num_warps=8,
1927-
num_stages=2,
1928-
waves_per_eu=1
1929-
)) # 20% improvement
1924+
configs.append(
1925+
triton_config_with_settings(
1926+
size_hints, 2048, num_warps=8, num_stages=2, waves_per_eu=1
1927+
)
1928+
) # 20% improvement
19301929
if len(size_hints) == 2:
19311930
# Only avoiding tuning on TileHint.SQUARE if not on ROCm builds
19321931
# ROCm has observed improvement by diverging here
19331932
if (
1934-
disable_pointwise_autotuning(inductor_meta)
1935-
or (torch.version.hip is None and tile_hint == TileHint.SQUARE)
1933+
disable_pointwise_autotuning(inductor_meta)
1934+
or (torch.version.hip is None and tile_hint == TileHint.SQUARE)
19361935
) and not (
19371936
inductor_meta.get("max_autotune")
19381937
or inductor_meta.get("max_autotune_pointwise")
@@ -1941,13 +1940,19 @@ def pointwise(
19411940
else:
19421941
configs = [
19431942
triton_config_with_settings(size_hints, 32, 32),
1944-
triton_config_with_settings(size_hints, 64, 32), # better for some kernels
1943+
triton_config_with_settings(
1944+
size_hints, 64, 32
1945+
), # better for some kernels
19451946
triton_config_with_settings(size_hints, 64, 64), # ~8% better for fp16
19461947
triton_config_with_settings(size_hints, 256, 16),
19471948
triton_config_with_settings(size_hints, 16, 256),
1948-
triton_config_with_settings(size_hints, 128, 16), # +10% for some kernels
1949-
triton_config_with_settings(size_hints, 128, 32), # additional 10% more
1950-
triton_config_with_settings(size_hints, 32, 512), # +30% for some kernels
1949+
triton_config_with_settings(
1950+
size_hints, 128, 16
1951+
), # +10% for some kernels
1952+
triton_config_with_settings(size_hints, 128, 32), # additional 10% more
1953+
triton_config_with_settings(
1954+
size_hints, 32, 512
1955+
), # +30% for some kernels
19511956
triton_config_with_settings(size_hints, bs, 1),
19521957
triton_config_with_settings(size_hints, 1, bs),
19531958
*hinted_configs,

0 commit comments

Comments
 (0)