Skip to content

Commit

Permalink
fix workload release bug
Browse files Browse the repository at this point in the history
  • Loading branch information
1ntEgr8 committed Nov 27, 2024
1 parent 7387b06 commit 1461a3c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 0 additions & 2 deletions rpc/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ def __init__(self) -> None:

# Enable orchestrated mode
FLAGS.orchestrated = True
# Set minimum placement push duration to 1s
FLAGS.min_placement_push_duration = 1_000_000
# Set scheduler runtime to zero
FLAGS.scheduler_runtime = 0

Expand Down
11 changes: 11 additions & 0 deletions simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,8 @@ def tick(self, until: EventTime) -> None:
"""Tick the simulator until the specified time"""

def f():
self._logger.debug(f"EQ: {self._event_queue}")

time_until_next_event = self.__time_until_next_event()

if (
Expand Down Expand Up @@ -1618,6 +1620,14 @@ def __handle_update_workload(self, event: Event) -> None:

# Release the Tasks that have become available.
releasable_tasks = self._workload.get_releasable_tasks()

# Ignore non-source tasks, they get auto-released when the parent finishes
def is_source_task(task):
task_graph = self._workload.get_task_graph(task.task_graph)
return task_graph.is_source_task(task)

releasable_tasks = [task for task in releasable_tasks if is_source_task(task)]

self._logger.info(
"[%s] The WorkloadLoader %s has %s TaskGraphs that released %s tasks.",
self._simulator_time.to(EventTime.Unit.US).time,
Expand Down Expand Up @@ -1666,6 +1676,7 @@ def __handle_update_workload(self, event: Event) -> None:

max_release_time = self._simulator_time
for task in releasable_tasks:

event = Event(
event_type=EventType.TASK_RELEASE, time=task.release_time, task=task
)
Expand Down

0 comments on commit 1461a3c

Please sign in to comment.