Skip to content
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

Fixes threshold handling for feature experiments #853

Merged
merged 2 commits into from
Oct 23, 2023
Merged
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
12 changes: 10 additions & 2 deletions varats/varats/experiments/vara/feature_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
Compile,
Clean,
)
from benchbuild.utils.requirements import Requirement, SlurmMem
from plumbum import local

from varats.experiment.experiment_util import (
Expand Down Expand Up @@ -72,6 +73,8 @@ class FeatureExperiment(VersionExperiment, shorthand=""):

REPORT_SPEC = ReportSpecification()

REQUIREMENTS: tp.List[Requirement] = [SlurmMem("250G")]

@abstractmethod
def actions_for_project(self,
project: VProject) -> tp.MutableSequence[Step]:
Expand Down Expand Up @@ -180,18 +183,23 @@ def get_vara_tracing_cflags(
Returns: list of tracing specific cflags
"""
c_flags = []

if instr_type != FeatureInstrType.NONE:
c_flags += ["-fsanitize=vara", f"-fvara-instr={instr_type.value}"]

c_flags += [
"-flto", "-fuse-ld=lld", "-flegacy-pass-manager",
"-fno-omit-frame-pointer"
]
if instruction_threshold is not None:

if instruction_threshold is None:
# For test projects, do not exclude small regions
if project is not None and project.domain == ProjectDomains.TEST:
instruction_threshold = 1

if instruction_threshold is not None:
c_flags += [f"-fvara-instruction-threshold={instruction_threshold}"]

if save_temps:
c_flags += ["-Wl,-plugin-opt=save-temps"]

Expand Down Expand Up @@ -230,7 +238,7 @@ def __call__(self) -> StepResult:

def __str__(self, indent: int = 0) -> str:
return textwrap.indent(
f"* {self.project.name}: Run instrumentation verifier", indent * " "
f"* {self.project.name}: Run instrumented code", indent * " "
)

def run_traced_code(self) -> StepResult:
Expand Down
Loading