Skip to content

Commit 442c6a1

Browse files
Alex Fanalexxfan
Alex Fan
authored andcommitted
add G on memory parameters
1 parent bbed0ef commit 442c6a1

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/codeflare_sdk/cluster/config.py

+10-9
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@ class ClusterConfiguration:
3838
head_info: list = field(default_factory=list)
3939
head_cpus: typing.Union[int, str] = 2
4040
head_memory: typing.Union[int, str] = 8
41-
head_gpus: int = None
41+
head_gpus: int = None # Deprecating
4242
num_head_gpus: int = 0
4343
machine_types: list = field(default_factory=list) # ["m4.xlarge", "g4dn.xlarge"]
4444
worker_cpu_requests: typing.Union[int, str] = 1
4545
worker_cpu_limits: typing.Union[int, str] = 1
46-
min_cpus: typing.Union[int, str] = None
47-
max_cpus: typing.Union[int, str] = None
46+
min_cpus: typing.Union[int, str] = None # Deprecating
47+
max_cpus: typing.Union[int, str] = None # Deprecating
4848
num_workers: int = 1
4949
worker_memory_requests: typing.Union[int, str] = 2
5050
worker_memory_limits: typing.Union[int, str] = 2
51-
min_memory: typing.Union[int, str] = None
52-
max_memory: typing.Union[int, str] = None
51+
min_memory: typing.Union[int, str] = None # Deprecating
52+
max_memory: typing.Union[int, str] = None # Deprecating
5353
num_worker_gpus: int = 0
54-
num_gpus: int = None
54+
num_gpus: int = None # Deprecating
5555
template: str = f"{dir}/templates/base-template.yaml"
5656
instascale: bool = False
5757
mcad: bool = False
@@ -68,11 +68,12 @@ def __post_init__(self):
6868
print(
6969
"Warning: TLS verification has been disabled - Endpoint checks will be bypassed"
7070
)
71+
7172
self._memory_to_string()
7273
self._str_mem_no_unit_add_GB()
74+
self._memory_to_resource()
7375
self._gpu_to_resource()
7476
self._cpu_to_resource()
75-
self._memory_to_resource()
7677

7778
def _str_mem_no_unit_add_GB(self):
7879
if isinstance(self.head_memory, str) and self.head_memory.isdecimal():
@@ -115,9 +116,9 @@ def _cpu_to_resource(self):
115116
def _memory_to_resource(self):
116117
if self.min_memory:
117118
warnings.warn("min_memory is being deprecated, use worker_memory_requests")
118-
self.worker_memory_requests = self.min_memory
119+
self.worker_memory_requests = f"{self.min_memory}G"
119120
if self.max_memory:
120121
warnings.warn("max_memory is being deprecated, use worker_memory_limits")
121-
self.worker_memory_limits = self.max_memory
122+
self.worker_memory_limits = f"{self.max_memory}G"
122123

123124
local_queue: str = None

0 commit comments

Comments
 (0)