Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/2.5] Enabled force_shape_pad for test_pad_mm and test_slice_mm_bandwidth_computation #1755

Open
wants to merge 2 commits into
base: release/2.5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion test/inductor/test_kernel_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,9 @@ def f(a, b, c):
self.check_bandwidth(compiled_module, "0.006")

@expectedFailureXPU
@config.patch(max_autotune=True, max_autotune_gemm_backends="TRITON")
@inductor_config.patch(max_autotune=True,
max_autotune_gemm_backends="TRITON",
force_shape_pad=True)
def test_slice_mm_bandwidth_computation(self):
M, N, K = 1000, 2000, 3000

Expand Down
36 changes: 27 additions & 9 deletions test/inductor/test_pad_mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ def setUp(self):
if not is_big_gpu(0):
return self.skipTest("Need a big GPU to run max_autotune=True")

@inductor_config.patch(max_autotune=True, max_autotune_gemm_backends="TRITON")
@inductor_config.patch(max_autotune=True,
max_autotune_gemm_backends="TRITON",
force_shape_pad=True)
def test_pad_mm_dyn_m(self):
M = 40
K1 = 581
Expand Down Expand Up @@ -53,7 +55,9 @@ def forward(self, a):
FileCheck().check(f"K = {aligned_k}").run(code)
self.assertEqual(res1, res2)

@inductor_config.patch(max_autotune=True, max_autotune_gemm_backends="TRITON")
@inductor_config.patch(max_autotune=True,
max_autotune_gemm_backends="TRITON",
force_shape_pad=True)
def test_cat_pad_mm_dyn_m(self):
M1 = 128
M2 = 40
Expand Down Expand Up @@ -88,7 +92,9 @@ def forward(self, a, b):
FileCheck().check(f"K = {aligned_k}").run(code)
self.assertEqual(res1, res2)

@inductor_config.patch(max_autotune=True, max_autotune_gemm_backends="TRITON")
@inductor_config.patch(max_autotune=True,
max_autotune_gemm_backends="TRITON",
force_shape_pad=True)
def test_pad_mm_dyn_n(self):
M = 20
K = 81
Expand All @@ -115,7 +121,9 @@ def forward(self, a, b):
FileCheck().check(f"K = {aligned_k}").run(code)
self.assertEqual(res1, res2)

@inductor_config.patch(max_autotune=True, max_autotune_gemm_backends="TRITON")
@inductor_config.patch(max_autotune=True,
max_autotune_gemm_backends="TRITON",
force_shape_pad=True)
def test_pad_mm_dyn_k(self):
M = 21
K = 80
Expand Down Expand Up @@ -182,7 +190,9 @@ def addmm(x, a, b):
b = torch.randn(10, 100).cuda()
self.assertEqual(torch.compile(addmm)(x, a, b), addmm(x, a, b))

@inductor_config.patch(max_autotune=True, max_autotune_gemm_backends="TRITON")
@inductor_config.patch(max_autotune=True,
max_autotune_gemm_backends="TRITON",
force_shape_pad=True)
def test_pad_bmm_dyn_b(self):
B = 10
M = 128
Expand Down Expand Up @@ -211,7 +221,9 @@ def forward(self, a, b):
FileCheck().check(f"K = {aligned_k}").run(code)
self.assertEqual(res1, res2)

@inductor_config.patch(max_autotune=True, max_autotune_gemm_backends="TRITON")
@inductor_config.patch(max_autotune=True,
max_autotune_gemm_backends="TRITON",
force_shape_pad=True)
def test_pad_bmm_dyn_k(self):
B = 10
M = 128
Expand Down Expand Up @@ -240,7 +252,9 @@ def forward(self, a, b):
FileCheck().check(f"N = {aligned_n}").run(code)
self.assertEqual(res1, res2)

@inductor_config.patch(max_autotune=True, max_autotune_gemm_backends="TRITON")
@inductor_config.patch(max_autotune=True,
max_autotune_gemm_backends="TRITON",
force_shape_pad=True)
def test_pad_bmm_dyn_bm(self):
B = 10
M = 128
Expand Down Expand Up @@ -270,7 +284,9 @@ def forward(self, a, b):
FileCheck().check(f"N = {aligned_n}").run(code)
self.assertEqual(res1, res2)

@inductor_config.patch(max_autotune=True, max_autotune_gemm_backends="TRITON")
@inductor_config.patch(max_autotune=True,
max_autotune_gemm_backends="TRITON",
force_shape_pad=True)
def test_pad_addmm_dyn_m(self):
M = 128
K = 33
Expand Down Expand Up @@ -299,7 +315,9 @@ def forward(self, a, b, c):
FileCheck().check(f"K = {aligned_k}").run(code)
self.assertEqual(res1, res2)

@inductor_config.patch(max_autotune=True, max_autotune_gemm_backends="TRITON")
@inductor_config.patch(max_autotune=True,
max_autotune_gemm_backends="TRITON",
force_shape_pad=True)
def test_pad_addmm_dyn_mn(self):
M = 128
K = 33
Expand Down