Skip to content

Commit

Permalink
Added code to bump resources (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
alindkhare authored Apr 14, 2024
1 parent d9125db commit a476bc6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions data/alibaba_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def __init__(
self._task_cpu_usage_min = self._flags.alibaba_loader_task_cpu_usage_min
self._task_cpu_usage_max = self._flags.alibaba_loader_task_cpu_usage_max
self._task_cpu_usage_random = self._flags.alibaba_loader_task_cpu_usage_random
self._alibaba_bump_resources_of_low_duration_task = self._flags.alibaba_bump_resources_of_low_duration_task

def _construct_workload_definitions(
self,
Expand Down Expand Up @@ -549,6 +550,10 @@ def _convert_job_data_to_job_graph(
)
* self._task_cpu_multiplier
)
# bump up the resources of low duration tasks
if self._alibaba_bump_resources_of_low_duration_task and task.actual_duration < 4:
resource_usage = self._task_cpu_usage_max

job_resources_1 = Resources(
resource_vector={
Resource(name="Slot_1", _id="any"): resource_usage,
Expand Down
5 changes: 5 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@
"The divisor used when converting alibaba trace tasks task.cpu to slot. The lower "
"the number, the higher the slots.",
)
flags.DEFINE_bool(
"alibaba_bump_resources_of_low_duration_task",
False,
"If True, the lower duration task resources would be bumped to max",
)
flags.DEFINE_bool(
"alibaba_loader_task_cpu_usage_random",
False,
Expand Down

0 comments on commit a476bc6

Please sign in to comment.