Skip to content

Commit

Permalink
Make solver time limit configurable from flags.
Browse files Browse the repository at this point in the history
  • Loading branch information
sukritkalra committed Jan 24, 2024
1 parent a6b7384 commit 5af5f11
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions schedulers/tetrisched_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,12 @@ def __init__(
# Scheduler configuration.
self._scheduler_configuration = tetrisched.SchedulerConfig()
self._scheduler_configuration.optimize = self._enable_optimization_passes
self._scheduler_configuration.newSolutionTimeMs = 1 * 60 * 1000
self._scheduler_configuration.newSolutionTimeMs = (
# 1 minute interrupt by default.
1 * 60 * 1000
if _flags is None or _flags.scheduler_time_limit == -1
else _flags.scheduler_time_limit * 1000
)

# NOTE (Sukrit): We observe that solving each TaskGraph independently usually
# leads to more missed deadlines than required. To offset this, the following
Expand Down Expand Up @@ -469,7 +474,7 @@ def schedule(
# Find the TaskGraphs that are past their reconsideration deadline and cancel
# those upfront.
cancelled_task_graphs: Set[str] = set()
if self._release_taskgraphs:
if self.release_taskgraphs and self.enforce_deadlines:
cancelled_task_graphs = self._cancel_task_graphs(
current_time=sim_time,
task_graph_names=task_graph_names,
Expand Down

0 comments on commit 5af5f11

Please sign in to comment.