Skip to content

Commit 5571b10

Browse files
committed
Update memory units from MB to MiB
1 parent 9facfe6 commit 5571b10

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

R/R/decorators-aws.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#'
1515
#' @param cpu Integer number of CPUs required for this step. Defaults to `1`.
1616
#' @param gpu Integer number of GPUs required for this step. Defaults to `0`.
17-
#' @param memory Integer memory size (in MB) required for this step. Defaults to
17+
#' @param memory Integer memory size (in MiB) required for this step. Defaults to
1818
#' `4096`.
1919
#' @param image Character. Specifies the image to use when launching on AWS
2020
#' Batch. If not specified, an appropriate

R/man/batch.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

metaflow/plugins/aws/batch/batch_decorator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class BatchDecorator(StepDecorator):
4141
Number of GPUs required for this step. If `@resources` is
4242
also present, the maximum value from all decorators is used.
4343
memory : int, default 4096
44-
Memory size (in MB) required for this step. If
44+
Memory size (in MiB) required for this step. If
4545
`@resources` is also present, the maximum value from all decorators is
4646
used.
4747
image : str, optional, default None

metaflow/plugins/kubernetes/kube_utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import re
22
from typing import Dict, List, Optional
3+
34
from metaflow.exception import CommandException, MetaflowException
45
from metaflow.util import get_username, get_latest_run_id
56

@@ -43,8 +44,8 @@ def qos_requests_and_limits(qos: str, cpu: int, memory: int, storage: int):
4344
# Guaranteed - has both cpu/memory limits. requests not required, as these will be inferred.
4445
qos_limits = {
4546
"cpu": str(cpu),
46-
"memory": "%sM" % str(memory),
47-
"ephemeral-storage": "%sM" % str(storage),
47+
"memory": "%sMi" % str(memory),
48+
"ephemeral-storage": "%sMi" % str(storage),
4849
}
4950
# NOTE: Even though Kubernetes will produce matching requests for the specified limits, this happens late in the lifecycle.
5051
# We specify them explicitly here to make some K8S tooling happy, in case they rely on .resources.requests being present at time of submitting the job.
@@ -53,8 +54,8 @@ def qos_requests_and_limits(qos: str, cpu: int, memory: int, storage: int):
5354
# Burstable - not Guaranteed, and has a memory/cpu limit or request
5455
qos_requests = {
5556
"cpu": str(cpu),
56-
"memory": "%sM" % str(memory),
57-
"ephemeral-storage": "%sM" % str(storage),
57+
"memory": "%sMi" % str(memory),
58+
"ephemeral-storage": "%sMi" % str(storage),
5859
}
5960
# TODO: Add support for BestEffort once there is a use case for it.
6061
# BestEffort - no limit or requests for cpu/memory

metaflow/plugins/kubernetes/kubernetes_decorator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ class KubernetesDecorator(StepDecorator):
6161
Number of CPUs required for this step. If `@resources` is
6262
also present, the maximum value from all decorators is used.
6363
memory : int, default 4096
64-
Memory size (in MB) required for this step. If
64+
Memory size (in MiB) required for this step. If
6565
`@resources` is also present, the maximum value from all decorators is
6666
used.
6767
disk : int, default 10240
68-
Disk size (in MB) required for this step. If
68+
Disk size (in MiB) required for this step. If
6969
`@resources` is also present, the maximum value from all decorators is
7070
used.
7171
image : str, optional, default None

metaflow/plugins/resources_decorator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class ResourcesDecorator(StepDecorator):
2626
gpu : int, optional, default None
2727
Number of GPUs required for this step.
2828
disk : int, optional, default None
29-
Disk size (in MB) required for this step. Only applies on Kubernetes.
29+
Disk size (in MiB) required for this step. Only applies on Kubernetes.
3030
memory : int, default 4096
31-
Memory size (in MB) required for this step.
31+
Memory size (in MiB) required for this step.
3232
shared_memory : int, optional, default None
3333
The value for the size (in MiB) of the /dev/shm volume for this step.
3434
This parameter maps to the `--shm-size` option in Docker.

0 commit comments

Comments
 (0)