Skip to content
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
20 changes: 10 additions & 10 deletions python/tutorials/gluon/08-warp-specialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,19 +627,19 @@ def test_matmul_warp_specialized(M, N, K, BLOCK_M, BLOCK_N, BLOCK_K, num_buffers
A = torch.randn(M, K, device="cuda", dtype=torch.float16)
B = torch.randn(K, N, device="cuda", dtype=torch.float16)
BT = B.T.contiguous()
r0 = as_flops(triton.testing.do_bench_cudagraph(lambda: matmul_warp_specialized(A, B, C, **args)))
r0 = as_flops(triton.testing.do_bench(lambda: matmul_warp_specialized(A, B, C, **args)))
r1 = as_flops(triton.testing.do_bench(lambda: cublas.matmul(A, BT, C)))
print(f"{K:>5} {r0:>17.2f} {r1:>9.2f}")

# %%
# K warp-specialized cublas
# 512 1160.28 1130.67
# 1024 1249.69 1148.52
# 2048 1347.18 1261.59
# 4096 1390.95 1299.38
# 8192 1350.01 1401.10
# 16384 1448.14 1508.76
# 512 1004.18 1191.77
# 1024 1182.61 1334.85
# 2048 1313.71 1400.35
# 4096 1317.58 1432.32
# 8192 1291.56 1301.11
# 16384 1256.74 1335.24
#
# Much better! We are beating cublas on small K, even though there is still lots
# of tuning we can do to improve performance. On Blackwell, warp specialization
# is critical for achieving peak performance.
# Much better! We are now quite competitive with cublas.
# We will show in tutorial 14-multicta.py how we can use multicta and a few other
# tricks to consistently beat cublas in a wide range of shapes.
Loading
Loading