From 8329f2aabf5a249d57e260bea0226af800cbf0a7 Mon Sep 17 00:00:00 2001 From: "Zhang, Jianyi" Date: Wed, 16 Oct 2024 23:38:31 -0700 Subject: [PATCH] add a sync after flush cache when doing benchmark --- python/triton/testing.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/triton/testing.py b/python/triton/testing.py index fb3f59b64c..73fc865fa9 100644 --- a/python/triton/testing.py +++ b/python/triton/testing.py @@ -204,6 +204,8 @@ def do_bench(fn, warmup=25, rep=100, grad_to_none=None, quantiles=None, return_m x.grad = None # we clear the L2 cache before each run cache.zero_() + if USE_WALL_TIME: + di.synchronize() # record time of `fn` start_event[i].record() fn()