Skip to content

Commit e9ad092

Browse files
committed
[operators] fix launch latency (#295)
1 parent 447d2a9 commit e9ad092

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

benchmarks/nightly/autogen.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,6 @@ rope_bwd:
140140
swiglu_bwd:
141141
op: swiglu
142142
args: --op swiglu --baseline torch_swiglu --metrics speedup --bwd --only liger_swiglu,torch_swiglu
143+
launch_latency:
144+
op: launch_latency
145+
args: --op launch_latency --metrics walltime

benchmarks/nightly/gen.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ def process_manual_options(
7676
run_configs[benchmark]["disabled"] = True
7777
for benchmark in extra_args:
7878
run_configs[benchmark]["args"] = extra_args[benchmark]["args"]
79+
for benchmark, benchmark_config in options.get("enabled", {}).items():
80+
run_configs[benchmark] = benchmark_config.copy()
7981
return run_configs
8082

8183

benchmarks/nightly/manual.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ disabled:
77
- fp8_gemm_fwd
88
- fp8_gemm_rowwise_fwd
99
- fp8_gemm_rowwise_grouped_fwd
10+
enabled:
11+
launch_latency:
12+
op: launch_latency
13+
args: --op launch_latency --metrics walltime
1014
extra_args:
1115
# triton_tutorial_flash_v2_opt does not work on Triton main branch
1216
bf16_flash_attention_fwd:

tritonbench/operators/launch_latency/operator.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import triton.language as tl
22
from torch import zeros
33
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
4+
5+
from torch._inductor.utils import triton_version_uses_attrs_dict
46
from triton.compiler import CompiledKernel
57

68
from tritonbench.utils.triton_op import (
@@ -39,7 +41,10 @@ def nop_triton_compiled_kernel_run(self, *args):
3941

4042
else:
4143
bin = nop_with_args_kernel[1,](*args)
42-
args = args[:-5] # remove tl.constexpr args
44+
# triton <= 3.3 does not include tl.constexpr args in call
45+
# but triton 3.4 does
46+
if not triton_version_uses_attrs_dict():
47+
args = args[:-5]
4348
function = bin.function
4449
metadata = (
4550
bin.packed_metadata if hasattr(bin, "packed_metadata") else bin.metadata

0 commit comments

Comments
 (0)