Skip to content

Commit f80f0b8

Browse files
committed
Conditionalize xblock values for HIP.
1 parent 1363a1c commit f80f0b8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

torch/_inductor/runtime/triton_heuristics.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2097,9 +2097,14 @@ def _persistent_reduction_configs(
20972097
or inductor_meta.get("max_autotune_pointwise")
20982098
)
20992099

2100+
if torch.version.hip:
2101+
xblock_vals = [1, 4, 8, 16, 32, 64, 128, 256]
2102+
else:
2103+
xblock_vals = [1, 8, 32, 128]
2104+
21002105
configs = [
21012106
triton_config_reduction(size_hints, xblock, rnumel, register_intensive=True)
2102-
for xblock in (1, 8, 32, 128)
2107+
for xblock in xblock_vals
21032108
if xblock == 1 or (xblock <= xnumel and (max_autotune_enabled or rnumel * xblock <= 4096))
21042109
]
21052110

0 commit comments

Comments
 (0)