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

feat(autotuner): skip loops with runtime contribution < 1 % #652

Merged
merged 1 commit into from
Aug 19, 2024
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
14 changes: 12 additions & 2 deletions discopop_library/EmpiricalAutotuning/Autotuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from discopop_library.EmpiricalAutotuning.ArgumentClasses import AutotunerArguments
from discopop_library.EmpiricalAutotuning.Classes.CodeConfiguration import CodeConfiguration
from discopop_library.EmpiricalAutotuning.Classes.ExecutionResult import ExecutionResult
from discopop_library.EmpiricalAutotuning.Statistics.StatisticsGraph import NodeShape, StatisticsGraph
from discopop_library.EmpiricalAutotuning.Statistics.StatisticsGraph import NodeColor, NodeShape, StatisticsGraph
from discopop_library.EmpiricalAutotuning.Types import SUGGESTION_ID
from discopop_library.EmpiricalAutotuning.utils import get_applicable_suggestion_ids
from discopop_library.HostpotLoader.HotspotLoaderArguments import HotspotLoaderArguments
Expand Down Expand Up @@ -107,10 +107,20 @@ def run(arguments: AutotunerArguments) -> None:
+ str(round(loop_tuple[4], 3))
+ "s"
)
statistics_graph.add_child(loop_str)
# check if the loop contributes more than 1% to the total runtime
loop_contributes_significantly = loop_tuple[4] > (
cast(ExecutionResult, reference_configuration.execution_result).runtime / 100
)
if not loop_contributes_significantly:
statistics_graph.add_child(loop_str, color=NodeColor.ORANGE)
else:
statistics_graph.add_child(loop_str)
statistics_graph.update_current_node(loop_str)
# identify all applicable suggestions for this loop
logger.debug(str(hotspot_type) + " loop: " + str(loop_tuple))
if not loop_contributes_significantly:
logger.debug("--> Skipping loop due to runtime contribution < 1%")
continue
# create code and execute for all applicable suggestions
applicable_suggestions = get_applicable_suggestion_ids(loop_tuple[0], loop_tuple[1], detection_result)
logger.debug("--> applicable suggestions: " + str(applicable_suggestions))
Expand Down
Loading