Skip to content

Commit a723c5e

Browse files
author
Andrija Kolic
committed
Set '--cmd-app-prefix-init-timelimit 60 --warmup-iteration-count 0 --throuhgput-iteration-count 0' Barista options when using the 'energy' tracker to account for the 60s baseline power consumption measurement stage and ensure a set workload independent from the VM's performance; include each phase in AGENT and INSTRUMENT_RUN stages.
1 parent 293a883 commit a723c5e

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

compiler/ci/ci_common/benchmark-suites.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129

130130
barista_template(suite_version=null, suite_name="barista", max_jdk_version=null, cmd_app_prefix=["hwloc-bind --cpubind node:0.core:0-3.pu:0 --membind node:0"], non_prefix_barista_args=[]):: cc.compiler_benchmark + {
131131
suite:: suite_name,
132-
local barista_version = "v0.3.4",
132+
local barista_version = "v0.4.1",
133133
local suite_version_args = if suite_version != null then ["--bench-suite-version=" + suite_version] else [],
134134
local prefix_barista_arg = if std.length(cmd_app_prefix) > 0 then [std.format("--cmd-app-prefix=%s", std.join(" ", cmd_app_prefix))] else [],
135135
local all_barista_args = prefix_barista_arg + non_prefix_barista_args,

sdk/mx.sdk/mx_sdk_benchmark.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2711,6 +2711,7 @@ def __init__(self, custom_harness_command: mx_benchmark.CustomHarnessCommand = N
27112711
super().__init__(custom_harness_command)
27122712
self._version = None
27132713
self._context = None
2714+
self._extra_run_options = []
27142715

27152716
@property
27162717
def context(self):
@@ -2799,6 +2800,17 @@ def register_tracker(self, name, tracker_type):
27992800
if tracker_type in _baristaConfig["disable_trackers"]:
28002801
mx.log(f"Ignoring the registration of '{name}' tracker as it was disabled for {self.__class__.__name__}.")
28012802
return
2803+
if name == "energy":
2804+
if self.version() < "0.4.1":
2805+
mx.abort(
2806+
"The 'energy' tracker is not supported for barista benchmarks before Barista version '0.4.1'."
2807+
" Please update your Barista repository in order to use the 'energy' tracker! Aborting!"
2808+
)
2809+
# Allow for the baseline measurement before looking up the app process
2810+
self._extra_run_options += ["--cmd-app-prefix-init-timelimit", f"{tracker_type(self).baseline_duration + 5}"]
2811+
# Ensure that the workload is independent from the performance of the VM
2812+
# We want to track the energy needed for a set amount of work
2813+
self._extra_run_options += ["--warmup-iteration-count", "0", "--throughput-iteration-count", "0"]
28022814
super().register_tracker(name, tracker_type)
28032815

28042816
def createCommandLineArgs(self, benchmarks, bmSuiteArgs):
@@ -3024,7 +3036,7 @@ def produceHarnessCommand(self, cmd, suite):
30243036
jvm_vm_options = jvm_cmd[index_of_java_exe + 1:]
30253037

30263038
# Verify that the run arguments don't already contain a "--mode" option
3027-
run_args = suite.runArgs(suite.context.bmSuiteArgs)
3039+
run_args = suite.runArgs(suite.context.bmSuiteArgs) + suite._extra_run_options
30283040
mode_pattern = r"^(?:-m|--mode)(=.*)?$"
30293041
mode_match = self._regexFindInCommand(run_args, mode_pattern)
30303042
if mode_match:

substratevm/mx.substratevm/mx_substratevm_benchmark.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,10 @@ def _short_load_testing_phases(self):
394394
"--startup-iteration-count", "1",
395395
"--warmup-iteration-count", "1",
396396
"--warmup-duration", "5",
397-
"--throughput-iteration-count", "0",
398-
"--latency-iteration-count", "0",
397+
"--throughput-iteration-count", "1",
398+
"--throughput-duration", "5",
399+
"--latency-iteration-count", "1",
400+
"--latency-duration", "5",
399401
]
400402

401403
def _get_built_app_image(self, suite, stage):
@@ -439,6 +441,7 @@ def produceHarnessCommand(self, cmd, suite):
439441
# Make agent run short
440442
cmd += self._short_load_testing_phases()
441443
# Add explicit agent stage args
444+
cmd += suite._extra_run_options
442445
cmd += mx_sdk_benchmark.parse_prefixed_args("-Dnative-image.benchmark.extra-jvm-arg=", suite.context.bmSuiteArgs)
443446
cmd += mx_sdk_benchmark.parse_prefixed_args("-Dnative-image.benchmark.extra-agent-run-arg=", suite.context.bmSuiteArgs)
444447
return cmd
@@ -461,7 +464,7 @@ def produceHarnessCommand(self, cmd, suite):
461464
ni_barista_cmd = [suite.baristaHarnessPath(), "--mode", "native", "--app-executable", app_image]
462465
if barista_workload is not None:
463466
ni_barista_cmd.append(f"--config={barista_workload}")
464-
ni_barista_cmd += suite.runArgs(suite.context.bmSuiteArgs)
467+
ni_barista_cmd += suite.runArgs(suite.context.bmSuiteArgs) + suite._extra_run_options
465468
ni_barista_cmd += mx_sdk_benchmark.parse_prefixed_args("-Dnative-image.benchmark.extra-jvm-arg=", suite.context.bmSuiteArgs)
466469
if stage == mx_sdk_benchmark.Stage.INSTRUMENT_RUN:
467470
# Make instrument run short

0 commit comments

Comments
 (0)