Skip to content

Commit 8329f2a

Browse files
committed
add a sync after flush cache when doing benchmark
1 parent f4fdd8f commit 8329f2a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

python/triton/testing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ def do_bench(fn, warmup=25, rep=100, grad_to_none=None, quantiles=None, return_m
204204
x.grad = None
205205
# we clear the L2 cache before each run
206206
cache.zero_()
207+
if USE_WALL_TIME:
208+
di.synchronize()
207209
# record time of `fn`
208210
start_event[i].record()
209211
fn()

0 commit comments

Comments
 (0)