Skip to content

[operators] fix launch latency #295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions benchmarks/nightly/autogen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,6 @@ rope_bwd:
swiglu_bwd:
op: swiglu
args: --op swiglu --baseline torch_swiglu --metrics speedup --bwd --only liger_swiglu,torch_swiglu
launch_latency:
op: launch_latency
args: --op launch_latency --metrics walltime
2 changes: 2 additions & 0 deletions benchmarks/nightly/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def process_manual_options(
run_configs[benchmark]["disabled"] = True
for benchmark in extra_args:
run_configs[benchmark]["args"] = extra_args[benchmark]["args"]
for benchmark, benchmark_config in options.get("enabled", {}).items():
run_configs[benchmark] = benchmark_config.copy()
return run_configs


Expand Down
4 changes: 4 additions & 0 deletions benchmarks/nightly/manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ disabled:
- fp8_gemm_fwd
- fp8_gemm_rowwise_fwd
- fp8_gemm_rowwise_grouped_fwd
enabled:
launch_latency:
op: launch_latency
args: --op launch_latency --metrics walltime
extra_args:
# triton_tutorial_flash_v2_opt does not work on Triton main branch
bf16_flash_attention_fwd:
Expand Down
8 changes: 4 additions & 4 deletions tools/python_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
DEFAULT_PYTHON_VERSION = "3.12"

PYTHON_VERSION_MAP = {
"3.11": {
"3.11": {
"pytorch_url": "cp311",
},
"3.12": {
},
"3.12": {
"pytorch_url": "cp312",
},
},
}
REPO_DIR = Path(__file__).parent.parent

Expand Down
7 changes: 6 additions & 1 deletion tritonbench/operators/launch_latency/operator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import triton.language as tl
from torch import zeros
from torch._C import _cuda_getCurrentRawStream as get_raw_stream

from torch._inductor.utils import triton_version_uses_attrs_dict
from triton.compiler import CompiledKernel

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

else:
bin = nop_with_args_kernel[1,](*args)
args = args[:-5] # remove tl.constexpr args
# triton <= 3.3 does not include tl.constexpr args in call
# but triton 3.4 does
if not triton_version_uses_attrs_dict():
args = args[:-5]
function = bin.function
metadata = (
bin.packed_metadata if hasattr(bin, "packed_metadata") else bin.metadata
Expand Down
Loading