[BC breaking] move benchmarking + prefer inductor path (#132827)

move benchmarking out of `torch._inductor.runtime.runtime_utils` and into `torch._inductor.runtime.benchmarking`, and prefer this path over directly accessing Triton's benchmarking

Fixes #ISSUE_NUMBER

Pull Request resolved: https://github.com/pytorch/pytorch/pull/132827
Approved by: https://github.com/eellison
This commit is contained in:
Nicolas Macchioni
2024-08-08 00:47:42 +00:00
committed by PyTorch MergeBot
parent a9036e1cf8
commit 5cb05a82b4
27 changed files with 248 additions and 163 deletions

View File

@ -1,4 +1,5 @@
import torch
from torch._inductor.runtime.benchmarking import benchmarker
def create_blocked_tensor(B, M, N, blocksize, sparsity, dtype, device):
@ -27,9 +28,7 @@ def create_blocked_tensor(B, M, N, blocksize, sparsity, dtype, device):
def _test_worker(test_func):
import triton
ms, ms_min, ms_max = triton.testing.do_bench(
ms, ms_min, ms_max = benchmarker.benchmark_gpu(
test_func, warmup=500, rep=100, fast_flush=False
)