mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[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:
committed by
PyTorch MergeBot
parent
a9036e1cf8
commit
5cb05a82b4
@ -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
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user