Skip to content

Commit

Permalink
Add option to disable denoise (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
smarr committed Jul 6, 2023
2 parents 3623d1c + b6af93e commit 025c616
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
run: pip install .

- name: Run Test Run
run: (cd rebench && rebench ../rebench.conf e:TestRunner2)
run: (cd rebench && rebench -D ../rebench.conf e:TestRunner2)

- name: Run Unit Tests
run: python -m pytest
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ The main feature of this release is the new support for custom
gauge adapters. This allows the use of a Python file from the
ReBench config, which can parse arbitrary output from a benchmark, see #209.

Furthermore, ReBench dropped support for Python 2. If you require ReBench to
run with Python 2, please see #208 for the removed supported code, or use
version 1.1.0, which was the last version with Python 2 support.


Other new features:
-
- add command-line option `-D` to disable the use of denoise (#217)

Other changes:
- fix handling of environment variables when sudo is used (#210)
-
- try `gtime` from MacPorts as alternative `time` command on macOS (#212)
- update py-cpuinfo to work on macOS with ARM-base CPUs (#212)
- make error more readable when executor is not available (#213)

## [1.1.0] Denoise - 2023-02-21

Expand Down
2 changes: 1 addition & 1 deletion rebench/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def init_environment(denoise_result, ui):
'hostName': u_name[1],
'osType': u_name[0],
'memory': virtual_memory().total,
'denoise': denoise_result.details
'denoise': {} if denoise_result is None else denoise_result.details
}

try:
Expand Down
6 changes: 4 additions & 2 deletions rebench/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,14 @@ class Executor(object):
def __init__(self, runs, do_builds, ui, include_faulty=False,
debug=False, scheduler=BatchScheduler, build_log=None,
artifact_review=False, use_nice=False, use_shielding=False,
print_execution_plan=False, config_dir=None):
print_execution_plan=False, config_dir=None,
use_denoise=True):
self.use_denoise=use_denoise
self._runs = runs

self._use_nice = use_nice
self._use_shielding = use_shielding
self.use_denoise = use_nice or use_shielding
self.use_denoise = self.use_denoise and (use_nice or use_shielding)

self._print_execution_plan = print_execution_plan

Expand Down
42 changes: 25 additions & 17 deletions rebench/rebench.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ def shell_options(self):
default=False,
help='Disables execution.'
' It allows to verify the configuration file and other parameters.')
execution.add_argument(
'-D', '--no-denoise', action='store_false', dest='use_denoise',
default=True,
help='Disable use of denoise, and thus, ' +
' do not try to minimize interference from the system during benchmarking.')
execution.add_argument(
'-p', '--execution-plan', action='store_true', dest='execution_plan',
default=False,
Expand Down Expand Up @@ -256,23 +261,26 @@ def run(self, argv=None):

runs = self._config.get_runs()
does_profiling = any(r.is_profiling() for r in runs)

denoise_result = None
show_denoise_warnings = not (self._config.artifact_review
or self._config.options.execution_plan)

try:
denoise_result = minimize_noise(show_denoise_warnings, self.ui, does_profiling)
init_environment(denoise_result, self.ui)

data_store.load_data(runs, self._config.options.do_rerun)

use_nice = denoise_result.use_nice
use_shielding = denoise_result.use_shielding

return self.execute_experiment(runs, use_nice, use_shielding)
finally:
restore_noise(denoise_result, show_denoise_warnings, self.ui)
if not self._config.options.use_denoise:
return self.load_data_and_execute_experiments(runs, data_store, False, False, None)
else:
denoise_result = None
show_denoise_warnings = not (self._config.artifact_review
or self._config.options.execution_plan)
try:
denoise_result = minimize_noise(show_denoise_warnings, self.ui, does_profiling)
use_nice = denoise_result.use_nice
use_shielding = denoise_result.use_shielding
return self.load_data_and_execute_experiments(
runs, data_store, use_nice, use_shielding, denoise_result)
finally:
restore_noise(denoise_result, show_denoise_warnings, self.ui)

def load_data_and_execute_experiments(self, runs, data_store,
use_nice, use_shielding, denoise_result):
init_environment(denoise_result, self.ui)
data_store.load_data(runs, self._config.options.do_rerun)
return self.execute_experiment(runs, use_nice, use_shielding)

def execute_experiment(self, runs, use_nice, use_shielding):
self.ui.verbose_output_info("Execute experiment: " + self._config.experiment_name + "\n")
Expand Down

0 comments on commit 025c616

Please sign in to comment.