From dedaad624f6142cf0b39e2615fcb0edcc5abfab2 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Wed, 20 Sep 2023 18:40:12 +0200 Subject: [PATCH] Don't allocate arrays during set-up; it introduces noise. --- benchmarks/blas.jl | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/benchmarks/blas.jl b/benchmarks/blas.jl index 01fa53e1..e71f77af 100644 --- a/benchmarks/blas.jl +++ b/benchmarks/blas.jl @@ -45,15 +45,10 @@ function blas_benchmark(group, a_type, b_type, cd_type, N, M=N, K=N; alpha=true, # NOTE: we use `cuStreamSynchronize` instead of `synchronize` to avoid # influence from the Julia scheduler - group[name] = @benchmarkable( - begin - GemmKernels.matmatmul!(c, $a_layout, $b_layout, a, b, $alpha, $beta; $(kwargs)...) - CUDA.cuStreamSynchronize(stream()) - end, - setup=(a=CuArray($a_h); b=CuArray($b_h); c=CuArray($c_h); - CUDA.cuStreamSynchronize(stream())), - teardown=(CUDA.unsafe_free!(a); CUDA.unsafe_free!(b); CUDA.unsafe_free!(c)) - ) + group[name] = @benchmarkable begin + GemmKernels.matmatmul!($c, $a_layout, $b_layout, $a, $b, $alpha, $beta; $(kwargs)...) + CUDA.cuStreamSynchronize(stream()) + end end let group = addgroup!(group, "WMMA")