[Benchmark] use flashinfer bench_gpu_time instead of triton do_bench (#20305)

This commit is contained in:
Mook
2026-03-12 04:04:30 +00:00
committed by GitHub
parent ae7c2397b9
commit abc672e717
13 changed files with 85 additions and 41 deletions
@@ -4,6 +4,7 @@ import torch
import torch.nn.functional as F
import triton.testing as tt
from sglang.benchmark.bench_utils import run_bench
from sglang.srt.layers.attention.triton_ops.extend_attention import extend_attention_fwd
@@ -270,9 +271,19 @@ def bench(
raise AssertionError("Mismatch between triton and torch reference.")
if provider == "triton":
ms = tt.do_bench(lambda: _run_triton(inputs), warmup=warmup, rep=rep)
ms = run_bench(
lambda: _run_triton(inputs),
quantiles=None,
warmup_ms=warmup,
rep_ms=rep,
)[0]
elif provider == "torch":
ms = tt.do_bench(lambda: _run_torch_ref(inputs), warmup=warmup, rep=rep)
ms = run_bench(
lambda: _run_torch_ref(inputs),
quantiles=None,
warmup_ms=warmup,
rep_ms=rep,
)[0]
else:
raise ValueError(provider)