Use `triton.testing.do_bench` to measure a GPU callable without mistaking Python launch time for GPU execution time. GPU launches are asynchronous, and the first call may also include one-time compilation; verify correctness separately and exclude that first-call cost from the measurement. section 2.2.10 section 2.2.10
triton.testing.do_bench(
fn,
warmup=25,
rep=100,
grad_to_none=None,
quantiles=None,
return_mode='mean',
)
The interface exposes warmup and repetition counts, optional quantiles, and a return mode. section 2.2.10
