Skip to content

Commit 4433700

Browse files
naromero77amdjataylo
authored andcommitted
Update autotune_lookup_tunable UT.
(cherry picked from commit 291ee06)
1 parent eea659c commit 4433700

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/inductor/test_async_compile.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,14 @@ def f(a, b):
7474
return (a @ b).to(torch.float32).sum(dim=1)
7575

7676
# Fake name to make sure the lookup table is name agnostic
77-
func_def = """
77+
# When codegen/triton.py is changed, func_def must be updated
78+
loop_header = (
79+
"for r0_offset in tl.range(0, r0_numel, R0_BLOCK, num_stages = 2):"
80+
if torch.version.hip
81+
else "for r0_offset in range(0, r0_numel, R0_BLOCK):"
82+
)
83+
84+
func_def = f"""
7885
def triton_fused_fake_name(in_ptr0, out_ptr0, xnumel, r0_numel, XBLOCK : tl.constexpr, R0_BLOCK : tl.constexpr):
7986
xnumel = 1024
8087
r0_numel = 11776
@@ -87,7 +94,7 @@ def triton_fused_fake_name(in_ptr0, out_ptr0, xnumel, r0_numel, XBLOCK : tl.cons
8794
rbase = r0_base
8895
x0 = xindex
8996
_tmp3 = tl.full([XBLOCK, R0_BLOCK], 0, tl.float32)
90-
for r0_offset in range(0, r0_numel, R0_BLOCK):
97+
{loop_header}
9198
r0_index = r0_offset + r0_base
9299
r0_mask = r0_index < r0_numel
93100
roffset = r0_offset

0 commit comments

Comments
 (0)