Skip to content

Commit 4165a69

Browse files
committed
Minor fix on the matmul example dim order
ghstack-source-id: ea48828 Pull-Request-resolved: #47
1 parent 96253e7 commit 4165a69

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/matmul.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ def matmul(x: torch.Tensor, y: torch.Tensor) -> torch.Tensor:
2323
return out
2424

2525

26-
def check(n: int, k: int, m: int) -> None:
26+
def check(m: int, k: int, n: int) -> None:
2727
from triton.testing import do_bench
2828

29-
x = torch.randn([n, k], device="cuda", dtype=torch.float16)
30-
y = torch.randn([k, m], device="cuda", dtype=torch.float16)
29+
x = torch.randn([m, k], device="cuda", dtype=torch.float16)
30+
y = torch.randn([k, n], device="cuda", dtype=torch.float16)
3131
result = matmul(x, y)
3232
torch.testing.assert_close(result, x @ y, rtol=1e-2, atol=1e-1)
3333
sec = do_bench(lambda: matmul(x, y))

0 commit comments

Comments
 (0)