Skip to content

Commit

Permalink
Implement CPU multiplier for Alibaba trace.
Browse files Browse the repository at this point in the history
  • Loading branch information
sukritkalra committed Mar 28, 2024
1 parent acea704 commit d3323cb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 6 additions & 2 deletions data/alibaba_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def __init__(
self._workload = Workload.empty(flags)
self._heterogeneous = self._flags.alibaba_enable_heterogeneous_resource_type

self._task_cpu_multiplier = self._flags.alibaba_loader_task_cpu_multiplier
self._task_cpu_divisor = self._flags.alibaba_loader_task_cpu_divisor
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
Expand Down Expand Up @@ -540,8 +541,11 @@ def _convert_job_data_to_job_graph(

if self._task_cpu_usage_random:
# We randomly generate the task CPU utilization between the bounds.
resource_usage = self._rng.randint(
self._task_cpu_usage_min, self._task_cpu_usage_max
resource_usage = (
self._rng.randint(
self._task_cpu_usage_min, self._task_cpu_usage_max
)
* self._task_cpu_multiplier
)
job_resources_1 = Resources(
resource_vector={
Expand Down
6 changes: 6 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@
)

# AlibabaLoader related flags.
flags.DEFINE_integer(
"alibaba_loader_task_cpu_multiplier",
1,
"The multiplier used on the resources after all the minimum and maximum clipping "
"has been done.",
)
flags.DEFINE_integer(
"alibaba_loader_task_cpu_divisor",
25,
Expand Down

0 comments on commit d3323cb

Please sign in to comment.