From 5af5f11068ae1b438f7f0b29d45e517f840690a2 Mon Sep 17 00:00:00 2001 From: Sukrit Kalra Date: Wed, 24 Jan 2024 11:20:21 -0800 Subject: [PATCH] Make solver time limit configurable from flags. --- schedulers/tetrisched_scheduler.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/schedulers/tetrisched_scheduler.py b/schedulers/tetrisched_scheduler.py index 9df9a987..728f2dff 100644 --- a/schedulers/tetrisched_scheduler.py +++ b/schedulers/tetrisched_scheduler.py @@ -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 @@ -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,