Skip to content

Expose compilation timeout programatically #114

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

Merged
merged 1 commit into from
Aug 31, 2022
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
9 changes: 5 additions & 4 deletions compiler_opt/rl/compilation_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ def is_priority_method(cls, method_name: str) -> bool:
def __init__(self,
clang_path: Optional[str] = None,
launcher_path: Optional[str] = None,
moving_average_decay_rate: float = 1):
moving_average_decay_rate: float = 1,
compilation_timeout=None):
"""Initialization of CompilationRunner class.

Args:
Expand All @@ -294,7 +295,9 @@ def __init__(self,
self._clang_path = clang_path
self._launcher_path = launcher_path
self._moving_average_decay_rate = moving_average_decay_rate
self._compilation_timeout = _COMPILATION_TIMEOUT.value
# Avoid reading the flag during the first interpretation of this module.
self._compilation_timeout = (
compilation_timeout or _COMPILATION_TIMEOUT.value)
self._cancellation_manager = WorkerCancellationManager()

# re-allow the cancellation manager accept work.
Expand All @@ -319,8 +322,6 @@ def collect_data(
module_spec: a ModuleSpec.
tf_policy_path: path to the tensorflow policy.
reward_stat: reward stat of this module, None if unknown.
cancellation_token: a CancellationToken through which workers may be
signaled early termination

Returns:
A CompilationResult. In particular:
Expand Down