Skip to content
Snippets Groups Projects
Commit 5ec071d9 authored by Simon Bjurek's avatar Simon Bjurek
Browse files

solved previous bug, now possible to schedule for different execution times,...

solved previous bug, now possible to schedule for different execution times, next step will be to write automatic tests
parent f36057d7
No related branches found
No related tags found
1 merge request!461Finalize earliest deadline scheduler
import sys
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from collections import defaultdict from collections import defaultdict
from typing import TYPE_CHECKING, Optional, cast from typing import TYPE_CHECKING, Optional, cast
...@@ -181,8 +182,6 @@ class EarliestDeadlineScheduler(Scheduler): ...@@ -181,8 +182,6 @@ class EarliestDeadlineScheduler(Scheduler):
Schedule to apply the scheduling algorithm on. Schedule to apply the scheduling algorithm on.
""" """
# TODO: Solve bug where operation (ADD) is scheduled before proceeding (MUL) -> pipelining
ALAPScheduler().apply_scheduling(schedule) ALAPScheduler().apply_scheduling(schedule)
# move all inputs ASAP to ensure correct operation # move all inputs ASAP to ensure correct operation
...@@ -211,7 +210,6 @@ class EarliestDeadlineScheduler(Scheduler): ...@@ -211,7 +210,6 @@ class EarliestDeadlineScheduler(Scheduler):
# update available operators # update available operators
for operation, ready_time in used_resources_ready_times.items(): for operation, ready_time in used_resources_ready_times.items():
print(ready_time, current_time)
if ready_time == current_time: if ready_time == current_time:
remaining_resources[operation.type_name()] += 1 remaining_resources[operation.type_name()] += 1
# remaining_resources = self._max_resources.copy() # remaining_resources = self._max_resources.copy()
...@@ -255,6 +253,9 @@ class EarliestDeadlineScheduler(Scheduler): ...@@ -255,6 +253,9 @@ class EarliestDeadlineScheduler(Scheduler):
source_end_times[op_id], source_end_times[op_id],
schedule.start_times[source_op.graph_id] + source_op.latency, schedule.start_times[source_op.graph_id] + source_op.latency,
) )
# ensure that the source is already scheduled
if source_op.graph_id in remaining_ops:
source_end_times[op_id] = sys.maxsize
# check resource constraints # check resource constraints
if operation.type_name() in remaining_resources: if operation.type_name() in remaining_resources:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment