Skip to content

Commit

Permalink
Implements multi case study feature perf plot generation
Browse files Browse the repository at this point in the history
  • Loading branch information
vulder committed Jan 30, 2024
1 parent a104345 commit f72003c
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions varats/varats/plots/feature_perf_precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from varats.plot.plot import Plot
from varats.plot.plots import PlotGenerator
from varats.plots.scatter_plot_utils import multivariate_grid
from varats.ts_utils.click_param_types import REQUIRE_MULTI_CASE_STUDY
from varats.utils.exceptions import UnsupportedOperation
from varats.utils.git_util import FullCommitHash

Expand Down Expand Up @@ -79,7 +80,7 @@ class PerfPrecisionDistPlot(Plot, plot_name='fperf_precision_dist'):
different profilers."""

def plot(self, view_mode: bool) -> None:
case_studies = get_loaded_paper_config().get_all_case_studies()
case_studies = self.plot_kwargs["case_studies"]
profilers: tp.List[Profiler] = [VXray(), PIMTracer(), EbpfTraceTEF()]

# Data aggregation
Expand Down Expand Up @@ -153,12 +154,40 @@ def calc_missing_revisions(


class PerfProfDistPlotGenerator(
PlotGenerator, generator_name="fperf-precision-dist", options=[]
PlotGenerator,
generator_name="fperf-precision-dist",
options=[REQUIRE_MULTI_CASE_STUDY]
):
"""Generates performance distribution plot."""
"""Generates performance distribution plot for a given amount of case
studies."""

def generate(self) -> tp.List[Plot]:
return [PerfPrecisionDistPlot(self.plot_config, **self.plot_kwargs)]
case_studies = self.plot_kwargs.pop("case_study")
return [
PerfPrecisionDistPlot(
self.plot_config, case_studies=case_studies, **self.plot_kwargs
)
]


class PerfProfDistPlotGeneratorForEachCS(
PlotGenerator,
generator_name="fperf-precision-dist-cs",
options=[REQUIRE_MULTI_CASE_STUDY]
):
"""Generates performance distribution plot for each of the given case
studies."""

def generate(self) -> tp.List[Plot]:
case_studies = self.plot_kwargs.pop("case_study")
return [
PerfPrecisionDistPlot(
self.plot_config,
case_study=case_study,
case_studies=[case_study],
**self.plot_kwargs
) for case_study in case_studies
]


class PerfOverheadPlot(Plot, plot_name='fperf_overhead'):
Expand Down

0 comments on commit f72003c

Please sign in to comment.