Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added code to bump resources #94

Merged
merged 1 commit into from
Apr 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading