Skip to content

Commit 69dd5bc

Browse files
committed
Benchmark fixes.
1 parent 4c50e86 commit 69dd5bc

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

examples/batchmatmul.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function prepare(; benchmark::Bool=false,
7474
)
7575
end
7676

77-
function run(data; tm::Int=64, tn::Int=64, tk::Int=64, nruns::Int=1, warmup::Int=0)
77+
function run(data; tm::Int=128, tn::Int=128, tk::Int=64, nruns::Int=1, warmup::Int=0)
7878
(; A, B, C, M, N, Batch) = data
7979
grid = (cld(M, tm), cld(N, tn), Batch)
8080

examples/batchmatmul.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ def batchmatmul_cutile_kernel(A, B, C, tm: ct.Constant[int], tn: ct.Constant[int
2929
b = ct.load(B, index=(pid_batch, k, bidy), shape=(1, tk, tn), padding_mode=zero_pad)
3030
b = ct.reshape(b, (tk, tn))
3131

32+
# Convert to TF32 for tensor cores (Float32 inputs only)
33+
if A.dtype == ct.float32:
34+
a = ct.astype(a, ct.tfloat32)
35+
b = ct.astype(b, ct.tfloat32)
36+
3237
accumulator = ct.mma(a, b, acc=accumulator)
3338

3439
result = ct.astype(accumulator, C.dtype)
@@ -61,7 +66,7 @@ def prepare(*, benchmark: bool = False, Batch: int = None, M: int = None, K: int
6166
}
6267

6368

64-
def run(data, *, tm: int = 64, tn: int = 64, tk: int = 64, nruns: int = 1, warmup: int = 0):
69+
def run(data, *, tm: int = 128, tn: int = 128, tk: int = 64, nruns: int = 1, warmup: int = 0):
6570
"""Run batch matmul kernel with timing."""
6671
A, B, C = data["A"], data["B"], data["C"]
6772
Batch, M, N = data["Batch"], data["M"], data["N"]

examples/transpose.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def transpose_cutile_kernel(input, output, tile_m: ct.Constant[int], tile_n: ct.
1212
pid_m = ct.bid(0)
1313
pid_n = ct.bid(1)
1414
tile = ct.load(input, index=(pid_m, pid_n), shape=(tile_m, tile_n))
15-
tile_t = transpose(tile)
15+
tile_t = ct.transpose(tile)
1616
ct.store(output, index=(pid_n, pid_m), tile=tile_t)
1717

1818

0 commit comments

Comments
 (0)