oracle-ads 2.13.3__py3-none-any.whl → 2.13.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. ads/aqua/app.py +6 -0
  2. ads/aqua/client/openai_client.py +305 -0
  3. ads/aqua/common/entities.py +224 -2
  4. ads/aqua/common/enums.py +3 -0
  5. ads/aqua/common/utils.py +105 -3
  6. ads/aqua/config/container_config.py +9 -0
  7. ads/aqua/constants.py +29 -1
  8. ads/aqua/evaluation/entities.py +6 -1
  9. ads/aqua/evaluation/evaluation.py +191 -7
  10. ads/aqua/extension/aqua_ws_msg_handler.py +6 -36
  11. ads/aqua/extension/base_handler.py +13 -71
  12. ads/aqua/extension/deployment_handler.py +67 -76
  13. ads/aqua/extension/errors.py +19 -0
  14. ads/aqua/extension/utils.py +114 -2
  15. ads/aqua/finetuning/finetuning.py +50 -1
  16. ads/aqua/model/constants.py +3 -0
  17. ads/aqua/model/enums.py +5 -0
  18. ads/aqua/model/model.py +236 -24
  19. ads/aqua/modeldeployment/deployment.py +671 -152
  20. ads/aqua/modeldeployment/entities.py +551 -42
  21. ads/aqua/modeldeployment/inference.py +4 -5
  22. ads/aqua/modeldeployment/utils.py +525 -0
  23. ads/aqua/resources/gpu_shapes_index.json +94 -0
  24. ads/common/utils.py +1 -17
  25. ads/model/datascience_model.py +81 -21
  26. ads/model/service/oci_datascience_model.py +50 -42
  27. ads/opctl/operator/lowcode/forecast/model/factory.py +8 -1
  28. {oracle_ads-2.13.3.dist-info → oracle_ads-2.13.5.dist-info}/METADATA +8 -4
  29. {oracle_ads-2.13.3.dist-info → oracle_ads-2.13.5.dist-info}/RECORD +32 -29
  30. {oracle_ads-2.13.3.dist-info → oracle_ads-2.13.5.dist-info}/WHEEL +1 -1
  31. {oracle_ads-2.13.3.dist-info → oracle_ads-2.13.5.dist-info}/entry_points.txt +0 -0
  32. {oracle_ads-2.13.3.dist-info → oracle_ads-2.13.5.dist-info}/licenses/LICENSE.txt +0 -0
@@ -0,0 +1,525 @@
1
+ #!/usr/bin/env python
2
+ # Copyright (c) 2025 Oracle and/or its affiliates.
3
+ # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
4
+ """AQUA model deployment utils"""
5
+
6
+ import copy
7
+ import itertools
8
+ import logging
9
+ import math
10
+ from concurrent.futures import ThreadPoolExecutor
11
+ from typing import Dict, List, Optional
12
+
13
+ from ads.aqua.app import AquaApp
14
+ from ads.aqua.common.entities import ComputeShapeSummary
15
+ from ads.aqua.modeldeployment.entities import (
16
+ AquaDeploymentConfig,
17
+ ConfigurationItem,
18
+ GPUModelAllocation,
19
+ GPUShapeAllocation,
20
+ ModelDeploymentConfigSummary,
21
+ MultiModelConfig,
22
+ )
23
+ from ads.config import AQUA_MODEL_DEPLOYMENT_CONFIG
24
+
25
+ logger = logging.getLogger("ads.aqua")
26
+
27
+
28
+ class MultiModelDeploymentConfigLoader:
29
+ """
30
+ Processes multiple model deployment configurations to determine compatible GPU shapes
31
+ and calculate optimal GPU allocations.
32
+ """
33
+
34
+ MAX_WORKERS = 10 # Number of workers for asynchronous models detail loading
35
+
36
+ def __init__(self, deployment_app: AquaApp):
37
+ """
38
+ Initializes the processor with a reference to the `AquaDeploymentApp` to fetch model configurations.
39
+
40
+ Parameters
41
+ ----------
42
+ deployment_app : AquaDeploymentApp
43
+ An instance of AquaDeploymentApp used to fetch model deployment configurations.
44
+ """
45
+ self.deployment_app = deployment_app
46
+
47
+ def load(
48
+ self,
49
+ shapes: List[ComputeShapeSummary],
50
+ model_ids: List[str],
51
+ primary_model_id: Optional[str] = None,
52
+ ) -> ModelDeploymentConfigSummary:
53
+ """
54
+ Retrieves deployment configurations for multiple/single model and calculates compatible GPU allocations.
55
+
56
+ Parameters
57
+ ----------
58
+ shapes : List[ComputeShapeSummary]
59
+ Model deployment available shapes.
60
+ model_ids : List[str]
61
+ A list of OCIDs for the Aqua models.
62
+ primary_model_id : Optional[str], optional
63
+ The OCID of the primary Aqua model. If provided, GPU allocation prioritizes this model.
64
+ Otherwise, GPUs are evenly allocated.
65
+
66
+ Returns
67
+ -------
68
+ ModelDeploymentConfigSummary
69
+ A summary of the deployment configurations and GPU allocations. If GPU allocation
70
+ cannot be determined, an appropriate error message is included in the summary.
71
+ """
72
+ return self._load_multi_model_deployment_configuration(
73
+ shapes=shapes, model_ids=model_ids, primary_model_id=primary_model_id
74
+ )
75
+
76
+ def _load_multi_model_deployment_configuration(
77
+ self,
78
+ shapes: List[ComputeShapeSummary],
79
+ model_ids: List[str],
80
+ primary_model_id: Optional[str] = None,
81
+ ) -> ModelDeploymentConfigSummary:
82
+ """
83
+ Retrieves deployment configurations for multiple models and calculates compatible GPU allocations.
84
+
85
+ Parameters
86
+ ----------
87
+ shapes : List[ComputeShapeSummary]
88
+ Model deployment available shapes.
89
+ model_ids : List[str]
90
+ A list of OCIDs for the Aqua models.
91
+ primary_model_id : Optional[str], optional
92
+ The OCID of the primary Aqua model. If provided, GPU allocation prioritizes this model.
93
+ Otherwise, GPUs are evenly allocated.
94
+
95
+ Returns
96
+ -------
97
+ ModelDeploymentConfigSummary
98
+ A summary of the deployment configurations and GPU allocations. If GPU allocation
99
+ cannot be determined, an appropriate error message is included in the summary.
100
+ """
101
+ model_shape_gpu, available_shapes, summary = self._fetch_model_shape_gpu(
102
+ shapes=shapes, model_ids=model_ids
103
+ )
104
+
105
+ # Identify common deployment shapes among all models.
106
+ common_shapes, empty_configs = self._get_common_shapes(model_shape_gpu)
107
+ logger.debug(f"Common Shapes: {common_shapes} from: {model_shape_gpu}")
108
+
109
+ # If all models' shape configs are empty, use default deployment shapes instead
110
+ common_shapes = (
111
+ available_shapes
112
+ if empty_configs
113
+ else [
114
+ shape_name
115
+ for shape_name in common_shapes
116
+ if shape_name.upper() in available_shapes
117
+ ]
118
+ )
119
+ logger.debug(f"Available Common Shapes: {common_shapes}")
120
+
121
+ if not common_shapes:
122
+ summary.error_message = (
123
+ "The selected models do not share any available common deployment shapes. "
124
+ "Please ensure that all chosen models are compatible for multi-model deployment."
125
+ )
126
+ logger.debug(
127
+ f"No common deployment shapes found among selected models: {model_ids}"
128
+ )
129
+ return summary
130
+
131
+ # Compute GPU allocations based on the common shapes and optionally prioritize a primary model.
132
+ gpu_allocation = self._compute_gpu_allocation(
133
+ shapes=shapes,
134
+ common_shapes=common_shapes,
135
+ model_shape_gpu=model_shape_gpu,
136
+ primary_model_id=primary_model_id,
137
+ )
138
+
139
+ logger.debug(f"GPU Allocation: {gpu_allocation}")
140
+
141
+ if not gpu_allocation:
142
+ summary.error_message = (
143
+ "The selected models do not have a valid GPU allocation based on their current configurations. "
144
+ "Please select a different model group. If you are deploying custom models that lack AQUA service configuration, "
145
+ "refer to the deployment guidelines here: "
146
+ "https://github.com/oracle-samples/oci-data-science-ai-samples/blob/main/ai-quick-actions/multimodel-deployment-tips.md#custom_models"
147
+ )
148
+
149
+ logger.debug(
150
+ f"GPU allocation computation failed for selected models: {model_ids}"
151
+ )
152
+
153
+ return summary
154
+
155
+ summary.gpu_allocation = gpu_allocation
156
+ return summary
157
+
158
+ def _fetch_model_shape_gpu(
159
+ self, shapes: List[ComputeShapeSummary], model_ids: List[str]
160
+ ):
161
+ """Fetches dict of model shape and gpu, list of available shapes and builds `ModelDeploymentConfigSummary` instance."""
162
+ # Fetch deployment configurations concurrently.
163
+ logger.debug(f"Loading model deployment configuration for models: {model_ids}")
164
+ deployment_configs = self._fetch_deployment_configs_concurrently(model_ids)
165
+
166
+ logger.debug(f"Loaded config: {deployment_configs}")
167
+ model_shape_gpu, deployment = self._extract_model_shape_gpu(
168
+ deployment_configs=deployment_configs, shapes=shapes
169
+ )
170
+
171
+ # Initialize the summary result with the deployment configurations.
172
+ summary = ModelDeploymentConfigSummary(deployment_config=deployment)
173
+
174
+ # Filter out not available shapes
175
+ available_shapes = [item.name.upper() for item in shapes]
176
+ logger.debug(f"Service Available Shapes: {available_shapes}")
177
+
178
+ return model_shape_gpu, available_shapes, summary
179
+
180
+ def _fetch_deployment_configs_concurrently(
181
+ self, model_ids: List[str]
182
+ ) -> Dict[str, AquaDeploymentConfig]:
183
+ """Fetches deployment configurations in parallel using ThreadPoolExecutor."""
184
+ with ThreadPoolExecutor(max_workers=self.MAX_WORKERS) as executor:
185
+ results = executor.map(
186
+ lambda model_id: self.deployment_app.get_config(
187
+ model_id, AQUA_MODEL_DEPLOYMENT_CONFIG
188
+ ).config,
189
+ model_ids,
190
+ )
191
+
192
+ return {
193
+ model_id: AquaDeploymentConfig(**config)
194
+ for model_id, config in zip(model_ids, results)
195
+ }
196
+
197
+ def _extract_model_shape_gpu(
198
+ self,
199
+ deployment_configs: Dict[str, AquaDeploymentConfig],
200
+ shapes: List[ComputeShapeSummary],
201
+ ):
202
+ """Extracts shape and GPU count details from deployment configurations.
203
+ Supported shapes for multi model deployment will be collected from `configuration` entry in deployment config.
204
+ Supported shapes for single model deployment will be collected from `shape` entry in deployment config.
205
+ """
206
+ model_shape_gpu = {}
207
+ deployment = {}
208
+ is_single_model = len(deployment_configs) == 1
209
+
210
+ for model_id, config in deployment_configs.items():
211
+ # For multi model deployment, we cannot rely on .shape because some models, like Falcon-7B, can only be deployed on a single GPU card (A10.1).
212
+ # However, Falcon can also be deployed on a single card in other A10 shapes, such as A10.2.
213
+ # Our current configuration does not support this flexibility.
214
+ # For single model deployment, we use `config.shape` to find the available shapes.
215
+ multi_deployment_shape = (
216
+ list(set(config.configuration.keys()).union(set(config.shape or [])))
217
+ if is_single_model
218
+ else list(config.configuration.keys())
219
+ )
220
+
221
+ shape_total_gpus_available_map = {
222
+ deployment_shape.name.upper(): deployment_shape.gpu_specs.gpu_count
223
+ or None
224
+ for deployment_shape in shapes
225
+ if deployment_shape and deployment_shape.gpu_specs
226
+ }
227
+
228
+ model_shape_gpu[model_id] = {
229
+ shape.upper(): [
230
+ item.gpu_count
231
+ for item in config.configuration.get(
232
+ shape,
233
+ ConfigurationItem(
234
+ multi_model_deployment=(
235
+ [
236
+ MultiModelConfig(
237
+ gpu_count=shape_total_gpus_available_map.get(
238
+ shape.upper()
239
+ )
240
+ )
241
+ ]
242
+ if is_single_model
243
+ else []
244
+ )
245
+ ),
246
+ ).multi_model_deployment
247
+ ]
248
+ for shape in multi_deployment_shape
249
+ }
250
+
251
+ # For single-model deployments: if the shape is listed in the `shapes` section of the config,
252
+ # we include the maximum available GPU count for that shape in the allocation consideration.
253
+ if is_single_model:
254
+ for shape in model_shape_gpu[model_id]:
255
+ shape_total_gpu_count = shape_total_gpus_available_map.get(
256
+ shape.upper()
257
+ )
258
+ if (
259
+ shape in config.shape
260
+ and shape_total_gpu_count
261
+ and shape_total_gpu_count
262
+ not in model_shape_gpu[model_id][shape]
263
+ ):
264
+ model_shape_gpu[model_id][shape].append(shape_total_gpu_count)
265
+
266
+ deployment[model_id] = {
267
+ "shape": [shape.upper() for shape in config.shape],
268
+ "configuration": {
269
+ shape.upper(): config.configuration.get(shape, ConfigurationItem())
270
+ for shape in multi_deployment_shape
271
+ },
272
+ }
273
+
274
+ return model_shape_gpu, deployment
275
+
276
+ def _get_common_shapes(
277
+ self, model_shape_gpu: Dict[str, Dict[str, List[int]]]
278
+ ) -> tuple:
279
+ """Finds common shapes across all models."""
280
+ common_shapes_set = []
281
+ empty_configs = True
282
+ for shapes in model_shape_gpu.values():
283
+ if shapes:
284
+ common_shapes_set.append(set(shapes.keys()))
285
+ empty_configs = False
286
+ if not common_shapes_set:
287
+ return [], empty_configs
288
+ return list(set.intersection(*(common_shapes_set))), empty_configs
289
+
290
+ def _compute_gpu_allocation(
291
+ self,
292
+ shapes: List[ComputeShapeSummary],
293
+ common_shapes: List[str],
294
+ model_shape_gpu: Dict[str, Dict[str, List[int]]],
295
+ primary_model_id: Optional[str],
296
+ ) -> Dict[str, GPUShapeAllocation]:
297
+ """Computes GPU allocation for common shapes."""
298
+
299
+ gpu_allocation = {}
300
+
301
+ for common_shape in common_shapes:
302
+ total_gpus_available = 0
303
+
304
+ # search the shape in the available shapes list
305
+ shape_summary = next(
306
+ (shape for shape in shapes if shape.name.upper() == common_shape),
307
+ None,
308
+ )
309
+ if shape_summary and shape_summary.gpu_specs:
310
+ total_gpus_available = shape_summary.gpu_specs.gpu_count
311
+
312
+ # generate a list of possible gpu count from `total_gpus_available` for custom models
313
+ # without multi model deployment config
314
+ # model_gpu = {
315
+ # model: (
316
+ # shape_gpu[common_shape]
317
+ # if shape_gpu.get(common_shape, UNKNOWN)
318
+ # else self._generate_gpu_list(total_gpus_available)
319
+ # )
320
+ # for model, shape_gpu in model_shape_gpu.items()
321
+ # }
322
+
323
+ model_gpu = {
324
+ model: (shape_gpu.get(common_shape, []) or [])
325
+ for model, shape_gpu in model_shape_gpu.items()
326
+ }
327
+
328
+ is_compatible, combination = self._verify_compatibility(
329
+ total_gpus_available=total_gpus_available,
330
+ model_gpu_dict=model_gpu,
331
+ primary_model_id=primary_model_id,
332
+ )
333
+
334
+ if is_compatible:
335
+ gpu_allocation[common_shape] = GPUShapeAllocation(
336
+ models=combination, total_gpus_available=total_gpus_available
337
+ )
338
+
339
+ return gpu_allocation
340
+
341
+ @staticmethod
342
+ def _generate_gpu_list(total_gpus_available: int) -> list[int]:
343
+ """Generates a list of powers of 2 that's smaller than or equal to `total_gpus_available`.
344
+
345
+ Example
346
+ -------
347
+ input: 8
348
+ output: [1,2,4,8]
349
+
350
+ Parameters
351
+ ----------
352
+ total_gpus_available : int
353
+ Total GPU available
354
+
355
+ Returns
356
+ -------
357
+ list
358
+ A list of powers of 2.
359
+ """
360
+ if total_gpus_available < 1:
361
+ return []
362
+ return [2**i for i in range(int(math.log2(total_gpus_available)) + 1)]
363
+
364
+ def _verify_compatibility(
365
+ self,
366
+ total_gpus_available: int,
367
+ model_gpu_dict: Dict,
368
+ primary_model_id: str = None,
369
+ ) -> tuple:
370
+ """Calculates the gpu allocations for all compatible shapes.
371
+ If no primary Aqua model id provided, gpu count for each compatible shape will be evenly allocated.
372
+ If provided, gpu count for each compatible shape will be prioritized for primary model.
373
+
374
+ Example
375
+ -------
376
+
377
+ Case 1:
378
+ There is one compatible shape "BM.GPU.H100.8" for three models A, B, C, and each model has a gpu count as below:
379
+
380
+ A - BM.GPU.H100.8 - 1, 2, 4, 8
381
+ B - BM.GPU.H100.8 - 1, 2, 4, 8
382
+ C - BM.GPU.H100.8 - 1, 2, 4, 8
383
+
384
+ If no primary model is provided, the gpu allocation for A, B, C could be [2, 4, 2], [2, 2, 4] or [4, 2, 2]
385
+ If B is the primary model, the gpu allocation is [2, 4, 2] as B always gets the maximum gpu count.
386
+
387
+ Case 2:
388
+ There is one compatible shape "BM.GPU.H100.8" for three models A, B, C, and each model has a gpu count as below:
389
+
390
+ A - BM.GPU.H100.8 - 1
391
+ B - BM.GPU.H100.8 - 1, 2, 4
392
+ C - BM.GPU.H100.8 - 1, 2, 4
393
+
394
+ If no primary model is provided, the gpu allocation for A, B, C could be [1, 1, 2] or [1, 2, 1]
395
+ If C is the primary model, the gpu allocation is [1, 1, 2] as C always gets the maximum gpu count.
396
+
397
+ Parameters
398
+ ----------
399
+ model_gpu_dict: Dict
400
+ A dict of Aqua model and its gpu counts.
401
+ primary_model_id: str
402
+ The OCID of the primary Aqua model
403
+
404
+ Returns
405
+ -------
406
+ tuple:
407
+ A tuple of gpu count allocation result.
408
+ """
409
+ model_gpu_dict_copy = copy.deepcopy(model_gpu_dict)
410
+ # minimal gpu count needed to satisfy all models
411
+ minimal_gpus_needed = len(model_gpu_dict)
412
+ if primary_model_id and minimal_gpus_needed > 1:
413
+ primary_model_gpu_list = sorted(model_gpu_dict_copy.pop(primary_model_id))
414
+ primary_model_gpu_list.reverse()
415
+ combinations = self.get_combinations(model_gpu_dict_copy)
416
+ for gpu_count in primary_model_gpu_list:
417
+ current_gpus_available = total_gpus_available
418
+ while (
419
+ current_gpus_available >= minimal_gpus_needed
420
+ # or current_gpus_available == 1
421
+ ):
422
+ for combination in combinations:
423
+ if (
424
+ len(combination) == len(model_gpu_dict_copy)
425
+ and sum(combination.values())
426
+ == current_gpus_available - gpu_count
427
+ ):
428
+ combination[primary_model_id] = gpu_count
429
+ return (
430
+ True,
431
+ [
432
+ GPUModelAllocation(ocid=ocid, gpu_count=gpu_count)
433
+ for ocid, gpu_count in combination.items()
434
+ ],
435
+ )
436
+
437
+ current_gpus_available -= 1
438
+ # current_gpus_available = (
439
+ # 1 if current_gpus_available == 0 else current_gpus_available
440
+ # )
441
+ else:
442
+ combinations = self.get_combinations(model_gpu_dict_copy)
443
+ current_gpus_available = total_gpus_available
444
+ while (
445
+ current_gpus_available >= minimal_gpus_needed
446
+ # or current_gpus_available == 1
447
+ ):
448
+ minimal_difference = float("inf") # gets the positive infinity
449
+ optimal_combination = []
450
+ for combination in combinations:
451
+ if (
452
+ len(combination) == len(model_gpu_dict_copy)
453
+ and sum(combination.values()) == current_gpus_available
454
+ ):
455
+ difference = max(combination.values()) - min(
456
+ combination.values()
457
+ )
458
+ if difference < minimal_difference:
459
+ minimal_difference = difference
460
+ optimal_combination = combination
461
+
462
+ # find the optimal combination, no need to continue
463
+ if minimal_difference == 0:
464
+ break
465
+
466
+ if optimal_combination:
467
+ return (
468
+ True,
469
+ [
470
+ GPUModelAllocation(ocid=ocid, gpu_count=gpu_count)
471
+ for ocid, gpu_count in optimal_combination.items()
472
+ ],
473
+ )
474
+
475
+ current_gpus_available -= 1
476
+ # current_gpus_available = (
477
+ # 1 if current_gpus_available == 0 else current_gpus_available
478
+ # )
479
+
480
+ return (False, [])
481
+
482
+ @staticmethod
483
+ def get_combinations(input_dict: dict):
484
+ """Finds all unique combinations within input dict.
485
+
486
+ The input is a dict of {model:[gpu_count]} on a specific shape and this method will
487
+ return a list of all unique combinations of gpu allocation of each model.
488
+
489
+ For example:
490
+
491
+ input: {'model_a': [2, 4], 'model_b': [1, 2, 4], 'model_c': [1, 2, 8]}
492
+ output:
493
+ [
494
+ {'model_a': 2, 'model_b': 1, 'model_c': 1},
495
+ {'model_a': 2, 'model_b': 1, 'model_c': 2},
496
+ {'model_a': 2, 'model_b': 1, 'model_c': 8},
497
+ {'model_a': 2, 'model_b': 2, 'model_c': 1},
498
+ {'model_a': 2, 'model_b': 2, 'model_c': 2},
499
+ {'model_a': 2, 'model_b': 2, 'model_c': 8},
500
+ {'model_a': 2, 'model_b': 4, 'model_c': 1},
501
+ {'model_a': 2, 'model_b': 4, 'model_c': 2},
502
+ {'model_a': 2, 'model_b': 4, 'model_c': 8},
503
+ {'model_a': 4, 'model_b': 1, 'model_c': 1},
504
+ {'model_a': 4, 'model_b': 1, 'model_c': 2},
505
+ {'model_a': 4, 'model_b': 1, 'model_c': 8},
506
+ {'model_a': 4, 'model_b': 2, 'model_c': 1},
507
+ {'model_a': 4, 'model_b': 2, 'model_c': 2},
508
+ {'model_a': 4, 'model_b': 2, 'model_c': 8},
509
+ {'model_a': 4, 'model_b': 4, 'model_c': 1},
510
+ {'model_a': 4, 'model_b': 4, 'model_c': 2},
511
+ {'model_a': 4, 'model_b': 4, 'model_c': 8}
512
+ ]
513
+
514
+ Parameters
515
+ ----------
516
+ input_dict: dict
517
+ A dict of {model:[gpu_count]} on a specific shape
518
+
519
+ Returns
520
+ -------
521
+ list:
522
+ A list of all unique combinations of gpu allocation of each model.
523
+ """
524
+ keys, values = zip(*input_dict.items())
525
+ return [dict(zip(keys, v)) for v in itertools.product(*values)]
@@ -0,0 +1,94 @@
1
+ {
2
+ "shapes": {
3
+ "BM.GPU.A10.4": {
4
+ "gpu_count": 4,
5
+ "gpu_memory_in_gbs": 96,
6
+ "gpu_type": "A10"
7
+ },
8
+ "BM.GPU.A100-V2.8": {
9
+ "gpu_count": 8,
10
+ "gpu_memory_in_gbs": 640,
11
+ "gpu_type": "A100"
12
+ },
13
+ "BM.GPU.B4.8": {
14
+ "gpu_count": 8,
15
+ "gpu_memory_in_gbs": 320,
16
+ "gpu_type": "A100"
17
+ },
18
+ "BM.GPU.H100.8": {
19
+ "gpu_count": 8,
20
+ "gpu_memory_in_gbs": 640,
21
+ "gpu_type": "H100"
22
+ },
23
+ "BM.GPU.H200.8": {
24
+ "gpu_count": 8,
25
+ "gpu_memory_in_gbs": 1128,
26
+ "gpu_type": "H200"
27
+ },
28
+ "BM.GPU.L40S-NC.4": {
29
+ "gpu_count": 4,
30
+ "gpu_memory_in_gbs": 192,
31
+ "gpu_type": "L40S"
32
+ },
33
+ "BM.GPU.L40S.4": {
34
+ "gpu_count": 4,
35
+ "gpu_memory_in_gbs": 192,
36
+ "gpu_type": "L40S"
37
+ },
38
+ "BM.GPU.MI300X.8": {
39
+ "gpu_count": 8,
40
+ "gpu_memory_in_gbs": 1536,
41
+ "gpu_type": "MI300X"
42
+ },
43
+ "BM.GPU2.2": {
44
+ "gpu_count": 2,
45
+ "gpu_memory_in_gbs": 32,
46
+ "gpu_type": "P100"
47
+ },
48
+ "BM.GPU3.8": {
49
+ "gpu_count": 8,
50
+ "gpu_memory_in_gbs": 128,
51
+ "gpu_type": "V100"
52
+ },
53
+ "BM.GPU4.8": {
54
+ "gpu_count": 8,
55
+ "gpu_memory_in_gbs": 320,
56
+ "gpu_type": "A100"
57
+ },
58
+ "VM.GPU.A10.1": {
59
+ "gpu_count": 1,
60
+ "gpu_memory_in_gbs": 24,
61
+ "gpu_type": "A10"
62
+ },
63
+ "VM.GPU.A10.2": {
64
+ "gpu_count": 2,
65
+ "gpu_memory_in_gbs": 48,
66
+ "gpu_type": "A10"
67
+ },
68
+ "VM.GPU.A10.4": {
69
+ "gpu_count": 4,
70
+ "gpu_memory_in_gbs": 96,
71
+ "gpu_type": "A10"
72
+ },
73
+ "VM.GPU2.1": {
74
+ "gpu_count": 1,
75
+ "gpu_memory_in_gbs": 16,
76
+ "gpu_type": "P100"
77
+ },
78
+ "VM.GPU3.1": {
79
+ "gpu_count": 1,
80
+ "gpu_memory_in_gbs": 16,
81
+ "gpu_type": "V100"
82
+ },
83
+ "VM.GPU3.2": {
84
+ "gpu_count": 2,
85
+ "gpu_memory_in_gbs": 32,
86
+ "gpu_type": "V100"
87
+ },
88
+ "VM.GPU3.4": {
89
+ "gpu_count": 4,
90
+ "gpu_memory_in_gbs": 64,
91
+ "gpu_type": "V100"
92
+ }
93
+ }
94
+ }
ads/common/utils.py CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python
2
2
 
3
- # Copyright (c) 2020, 2024 Oracle and/or its affiliates.
3
+ # Copyright (c) 2020, 2025 Oracle and/or its affiliates.
4
4
  # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
5
5
 
6
6
 
@@ -152,22 +152,6 @@ def oci_key_location():
152
152
  )
153
153
 
154
154
 
155
- def text_sanitizer(content):
156
- if isinstance(content, str):
157
- return (
158
- content.replace("“", '"')
159
- .replace("”", '"')
160
- .replace("’", "'")
161
- .replace("‘", "'")
162
- .replace("—", "-")
163
- .encode("utf-8", "ignore")
164
- .decode("utf-8", "ignore")
165
- )
166
- if isinstance(content, dict):
167
- return json.dumps(content)
168
- return str(content)
169
-
170
-
171
155
  @deprecated(
172
156
  "2.5.10",
173
157
  details="Deprecated, use: from ads.common.auth import AuthState; AuthState().oci_config_path",