Skip to content

Commit

Permalink
Add usage logger to track user usage
Browse files Browse the repository at this point in the history
Summary: We would like to gather some data about how many users are using Tritonbench and the command line options.

Reviewed By: int3

Differential Revision: D59408795

fbshipit-source-id: 43c60936330aef521162fbe1eaf669cf33a8ffa5
  • Loading branch information
xuzhao9 authored and facebook-github-bot committed Jul 8, 2024
1 parent b35d297 commit ff1b8eb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions userbenchmark/triton/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import sys
import tempfile
import torch
from typing import List
from torch import version as torch_version
from torchbenchmark.operators import load_opbench_by_name
Expand All @@ -11,6 +12,11 @@
DEFAULT_RUN_ITERS,
DEFAULT_WARMUP,
)
if not hasattr(torch.version, "git_version"):
from pytorch.benchmark.fb.run_utils import usage_report_logger
else:
usage_report_logger = lambda *args, **kwargs: None


TRITON_BENCH_CSV_DUMP_PATH = tempfile.gettempdir() + "/tritonbench/"

Expand Down Expand Up @@ -84,6 +90,8 @@ def _run(args: argparse.Namespace, extra_args: List[str]) -> None:
def run(args: List[str] = []):
if args == []:
args = sys.argv[1:]
# Log the tool usage
usage_report_logger(benchmark_name="tritonbench")
args, extra_args = parse_args(args)
if args.ci:
from .ci import run_ci
Expand Down

0 comments on commit ff1b8eb

Please sign in to comment.