Skip to content

Commit cb70510

Browse files
chipspeakopenshift-merge-bot[bot]
authored andcommitted
task(RHOAIENG-26192): Removed dep fields head_gpus + num_gpus
Signed-off-by: Pat O'Connor <[email protected]>
1 parent 5c2495d commit cb70510

File tree

3 files changed

+0
-35
lines changed

3 files changed

+0
-35
lines changed

docs/sphinx/user-docs/cluster-configuration.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,3 @@ deprecated.
180180
- ``worker_memory_requests``
181181
* - ``max_memory``
182182
- ``worker_memory_limits``
183-
* - ``head_gpus``
184-
- ``head_extended_resource_requests``
185-
* - ``num_gpus``
186-
- ``worker_extended_resource_requests``

src/codeflare_sdk/ray/cluster/config.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ class ClusterConfiguration:
5454
The number of CPUs to allocate to the head node.
5555
head_memory:
5656
The amount of memory to allocate to the head node.
57-
head_gpus:
58-
The number of GPUs to allocate to the head node. (Deprecated, use head_extended_resource_requests)
5957
head_extended_resource_requests:
6058
A dictionary of extended resource requests for the head node. ex: {"nvidia.com/gpu": 1}
6159
head_tolerations:
@@ -70,8 +68,6 @@ class ClusterConfiguration:
7068
The minimum amount of memory to allocate to each worker.
7169
max_memory:
7270
The maximum amount of memory to allocate to each worker.
73-
num_gpus:
74-
The number of GPUs to allocate to each worker. (Deprecated, use worker_extended_resource_requests)
7571
worker_tolerations:
7672
List of tolerations for worker nodes.
7773
appwrapper:
@@ -120,7 +116,6 @@ class ClusterConfiguration:
120116
head_memory_requests: Union[int, str] = 8
121117
head_memory_limits: Union[int, str] = 8
122118
head_memory: Optional[Union[int, str]] = None # Deprecating
123-
head_gpus: Optional[int] = None # Deprecating
124119
head_extended_resource_requests: Dict[str, Union[str, int]] = field(
125120
default_factory=dict
126121
)
@@ -134,7 +129,6 @@ class ClusterConfiguration:
134129
worker_memory_limits: Union[int, str] = 2
135130
min_memory: Optional[Union[int, str]] = None # Deprecating
136131
max_memory: Optional[Union[int, str]] = None # Deprecating
137-
num_gpus: Optional[int] = None # Deprecating
138132
worker_tolerations: Optional[List[V1Toleration]] = None
139133
appwrapper: bool = False
140134
envs: Dict[str, str] = field(default_factory=dict)
@@ -195,7 +189,6 @@ def __post_init__(self):
195189
self._memory_to_string()
196190
self._str_mem_no_unit_add_GB()
197191
self._cpu_to_resource()
198-
self._gpu_to_resource()
199192
self._combine_extended_resource_mapping()
200193
self._validate_extended_resource_requests(self.head_extended_resource_requests)
201194
self._validate_extended_resource_requests(
@@ -227,26 +220,6 @@ def _validate_extended_resource_requests(self, extended_resources: Dict[str, int
227220
f"extended resource '{k}' not found in extended_resource_mapping, available resources are {list(self.extended_resource_mapping.keys())}, to add more supported resources use extended_resource_mapping. i.e. extended_resource_mapping = {{'{k}': 'FOO_BAR'}}"
228221
)
229222

230-
def _gpu_to_resource(self):
231-
if self.head_gpus:
232-
warnings.warn(
233-
f"head_gpus is being deprecated, replacing with head_extended_resource_requests['nvidia.com/gpu'] = {self.head_gpus}"
234-
)
235-
if "nvidia.com/gpu" in self.head_extended_resource_requests:
236-
raise ValueError(
237-
"nvidia.com/gpu already exists in head_extended_resource_requests"
238-
)
239-
self.head_extended_resource_requests["nvidia.com/gpu"] = self.head_gpus
240-
if self.num_gpus:
241-
warnings.warn(
242-
f"num_gpus is being deprecated, replacing with worker_extended_resource_requests['nvidia.com/gpu'] = {self.num_gpus}"
243-
)
244-
if "nvidia.com/gpu" in self.worker_extended_resource_requests:
245-
raise ValueError(
246-
"nvidia.com/gpu already exists in worker_extended_resource_requests"
247-
)
248-
self.worker_extended_resource_requests["nvidia.com/gpu"] = self.num_gpus
249-
250223
def _str_mem_no_unit_add_GB(self):
251224
if isinstance(self.head_memory, str) and self.head_memory.isdecimal():
252225
self.head_memory = f"{self.head_memory}G"

src/codeflare_sdk/ray/cluster/test_config.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ def test_config_creation_wrong_type():
139139
def test_cluster_config_deprecation_conversion(mocker):
140140
config = ClusterConfiguration(
141141
name="test",
142-
num_gpus=2,
143-
head_gpus=1,
144142
head_cpus=3,
145143
head_memory=16,
146144
min_memory=3,
@@ -152,8 +150,6 @@ def test_cluster_config_deprecation_conversion(mocker):
152150
assert config.head_cpu_limits == 3
153151
assert config.head_memory_requests == "16G"
154152
assert config.head_memory_limits == "16G"
155-
assert config.worker_extended_resource_requests == {"nvidia.com/gpu": 2}
156-
assert config.head_extended_resource_requests == {"nvidia.com/gpu": 1}
157153
assert config.worker_memory_requests == "3G"
158154
assert config.worker_memory_limits == "4G"
159155
assert config.worker_cpu_requests == 1

0 commit comments

Comments
 (0)