Skip to content

Commit

Permalink
Revert "[ci] Start capture process earlier to reduce benchmark repeti…
Browse files Browse the repository at this point in the history
…tions"
  • Loading branch information
antiagainst committed Jan 23, 2024
1 parent c3d93a5 commit 0d5f442
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
8 changes: 5 additions & 3 deletions build_tools/benchmarks/common/benchmark_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,14 @@ def get_iree_benchmark_module_arguments(
):
"""Returns the common arguments to run iree-benchmark-module."""

if capture_mode:
repetitions = 1
elif driver_info.loader_name == "vmvx-module":
if driver_info.loader_name == "vmvx-module":
# VMVX is very unoptimized for now and can take a long time to run.
# Decrease the repetition for it until it's reasonably fast.
repetitions = 3
elif capture_mode:
# Capture mode is slower and we just need enough repetition to collect
# trace after the warmup phase.
repetitions = 4
else:
repetitions = 10

Expand Down
28 changes: 7 additions & 21 deletions build_tools/benchmarks/run_benchmarks_on_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import shutil
import subprocess
import tarfile
import time

from common import benchmark_suite as benchmark_suite_module
from common.benchmark_driver import BenchmarkDriver
Expand Down Expand Up @@ -236,28 +235,15 @@ def __run_capture(
)
)

capture_cmd = [capture_config.trace_capture_tool, "-f", "-o", capture_filename]
if self.verbose:
print(f"cmd: {capture_cmd}")
stdout_redirect = None if self.verbose else subprocess.DEVNULL

# The benchmark process can finish and exit quickly. So start the
# capture process first.
subprocess.Popen(capture_cmd, stdout=stdout_redirect)

# Then start the benchmark process and wait for it to stop.
execute_cmd(
cmd,
env={"TRACY_NO_EXIT": "1"},
stdout=stdout_redirect,
verbose=self.verbose,
process = subprocess.Popen(
cmd, env={"TRACY_NO_EXIT": "1"}, stdout=subprocess.PIPE, text=True
)

# Some extra grace time to let the capture process finish collection.
# Note that we will start the next model's benchmarking and capturing
# afterwards; so in theory we can overlap here and might not even
# need this, but just to be conservative.
time.sleep(2)
wait_for_iree_benchmark_module_start(process, self.verbose)

capture_cmd = [capture_config.trace_capture_tool, "-f", "-o", capture_filename]
stdout_redirect = None if self.verbose else subprocess.DEVNULL
execute_cmd(capture_cmd, verbose=self.verbose, stdout=stdout_redirect)


def main(args):
Expand Down

0 comments on commit 0d5f442

Please sign in to comment.