Skip to content

Commit 86a6d57

Browse files
committed
Updated the GPU shapes index file to include additional shapes and corresponding CPU parameters.
1 parent 4bb5fb6 commit 86a6d57

File tree

2 files changed

+183
-38
lines changed

2 files changed

+183
-38
lines changed

ads/aqua/common/entities.py

Lines changed: 76 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -46,37 +46,77 @@ class Config:
4646
arbitrary_types_allowed = True
4747
protected_namespaces = ()
4848

49+
4950
class ComputeRank(Serializable):
5051
"""
51-
Represents the cost and performance ranking for a compute shape.
52+
Represents the cost and performance rankings for a specific compute shape.
53+
These rankings help compare different shapes based on their relative pricing
54+
and computational capabilities.
5255
"""
53-
cost: int = Field(
54-
None, description="The relative rank of the cost of the shape. Range is [10 (cost-effective), 100 (most-expensive)]"
56+
57+
cost: Optional[int] = Field(
58+
None,
59+
description=(
60+
"Relative cost ranking of the compute shape. "
61+
"Value ranges from 10 (most cost-effective) to 100 (most expensive). "
62+
"Lower values indicate cheaper compute options."
63+
),
5564
)
5665

57-
performance: int = Field(
58-
None, description="The relative rank of the performance of the shape. Range is [10 (lower performance), 110 (highest performance)]"
66+
performance: Optional[int] = Field(
67+
None,
68+
description=(
69+
"Relative performance ranking of the compute shape. "
70+
"Value ranges from 10 (lowest performance) to 110 (highest performance). "
71+
"Higher values indicate better compute performance."
72+
),
5973
)
6074

75+
6176
class GPUSpecs(Serializable):
6277
"""
63-
Represents the GPU specifications for a compute instance.
78+
Represents the specifications and capabilities of a GPU-enabled compute shape.
79+
Includes details about GPU and CPU resources, supported quantization formats, and
80+
relative rankings for cost and performance.
6481
"""
6582

66-
gpu_memory_in_gbs: Optional[int] = Field(
67-
default=None, description="The amount of GPU memory available (in GB)."
68-
)
6983
gpu_count: Optional[int] = Field(
70-
default=None, description="The number of GPUs available."
84+
default=None,
85+
description="Number of physical GPUs available on the compute shape.",
7186
)
87+
88+
gpu_memory_in_gbs: Optional[int] = Field(
89+
default=None, description="Total GPU memory available in gigabytes (GB)."
90+
)
91+
7292
gpu_type: Optional[str] = Field(
73-
default=None, description="The type of GPU (e.g., 'V100, A100, H100')."
93+
default=None,
94+
description="Type of GPU and architecture. Example: 'H100', 'GB200'.",
7495
)
96+
7597
quantization: Optional[List[str]] = Field(
76-
default_factory=list, description="The quantization format supported by shape. (ex. bitsandbytes, fp8, etc.)"
98+
default_factory=list,
99+
description=(
100+
"List of supported quantization formats for the GPU. "
101+
"Examples: 'fp16', 'int8', 'bitsandbytes', 'bf16', 'fp4', etc."
102+
),
103+
)
104+
105+
cpu_count: Optional[int] = Field(
106+
default=None, description="Number of CPU cores available on the shape."
77107
)
108+
109+
cpu_memory_in_gbs: Optional[int] = Field(
110+
default=None, description="Total CPU memory available in gigabytes (GB)."
111+
)
112+
78113
ranking: Optional[ComputeRank] = Field(
79-
None, description="The relative rank of the cost and performance of the shape."
114+
default=None,
115+
description=(
116+
"Relative cost and performance rankings of this shape. "
117+
"Cost is ranked from 10 (least expensive) to 100+ (most expensive), "
118+
"and performance from 10 (lowest) to 100+ (highest)."
119+
),
80120
)
81121

82122

@@ -97,50 +137,49 @@ class GPUShapesIndex(Serializable):
97137

98138
class ComputeShapeSummary(Serializable):
99139
"""
100-
Represents the specifications of a compute instance shape,
101-
including CPU, memory, and optional GPU characteristics.
140+
Represents a compute shape's specification including CPU, memory, and (if applicable) GPU configuration.
102141
"""
103142

104143
available: Optional[bool] = Field(
105-
default = False,
106-
description="True if shape is available on user tenancy, "
144+
default=False,
145+
description="True if the shape is available in the user's tenancy/region.",
107146
)
147+
108148
core_count: Optional[int] = Field(
109-
default=None,
110-
description="Total number of CPU cores available for the compute shape.",
149+
default=None, description="Number of vCPUs available for the compute shape."
111150
)
151+
112152
memory_in_gbs: Optional[int] = Field(
113-
default=None,
114-
description="Amount of memory (in GB) available for the compute shape.",
153+
default=None, description="Total CPU memory available for the shape (in GB)."
115154
)
155+
116156
name: Optional[str] = Field(
117-
default=None,
118-
description="Full name of the compute shape, e.g., 'VM.GPU.A10.2'.",
157+
default=None, description="Name of the compute shape, e.g., 'VM.GPU.A10.2'."
119158
)
159+
120160
shape_series: Optional[str] = Field(
121161
default=None,
122-
description="Shape family or series, e.g., 'GPU', 'Standard', etc.",
162+
description="Series or family of the shape, e.g., 'GPU', 'Standard'.",
123163
)
164+
124165
gpu_specs: Optional[GPUSpecs] = Field(
125-
default=None,
126-
description="Optional GPU specifications associated with the shape.",
166+
default=None, description="GPU configuration for the shape, if applicable."
127167
)
128168

129169
@model_validator(mode="after")
130170
@classmethod
131-
def set_gpu_specs(cls, model: "ComputeShapeSummary") -> "ComputeShapeSummary":
171+
def populate_gpu_specs(cls, model: "ComputeShapeSummary") -> "ComputeShapeSummary":
132172
"""
133-
Validates and populates GPU specifications if the shape_series indicates a GPU-based shape.
134-
135-
- If the shape_series contains "GPU", the validator first checks if the shape name exists
136-
in the GPU_SPECS dictionary. If found, it creates a GPUSpecs instance with the corresponding data.
137-
- If the shape is not found in the GPU_SPECS, it attempts to extract the GPU count from the shape name
138-
using a regex pattern (looking for a number following a dot at the end of the name).
173+
Attempts to populate GPU specs if the shape is GPU-based and no GPU specs are explicitly set.
139174
140-
The information about shapes is taken from: https://docs.oracle.com/en-us/iaas/data-science/using/supported-shapes.htm
175+
Logic:
176+
- If `shape_series` includes 'GPU' and `gpu_specs` is None:
177+
- Tries to parse the shape name to extract GPU count (e.g., from 'VM.GPU.A10.2').
178+
- Fallback is based on suffix numeric group (e.g., '.2' → gpu_count=2).
179+
- If extraction fails, logs debug-level error but does not raise.
141180
142181
Returns:
143-
ComputeShapeSummary: The updated instance with gpu_specs populated if applicable.
182+
ComputeShapeSummary: The updated model instance.
144183
"""
145184
try:
146185
if (
@@ -149,16 +188,15 @@ def set_gpu_specs(cls, model: "ComputeShapeSummary") -> "ComputeShapeSummary":
149188
and model.name
150189
and not model.gpu_specs
151190
):
152-
# Try to extract gpu_count from the shape name using a regex (e.g., "VM.GPU3.2" -> gpu_count=2)
153191
match = re.search(r"\.(\d+)$", model.name)
154192
if match:
155193
gpu_count = int(match.group(1))
156194
model.gpu_specs = GPUSpecs(gpu_count=gpu_count)
157195
except Exception as err:
158196
logger.debug(
159-
f"Error occurred in attempt to extract GPU specification for the f{model.name}. "
160-
f"Details: {err}"
197+
f"[populate_gpu_specs] Failed to auto-populate GPU specs for shape '{model.name}': {err}"
161198
)
199+
162200
return model
163201

164202

ads/aqua/resources/gpu_shapes_index.json

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,85 @@
11
{
2+
"BM.GPU.B200.8": {
3+
"cpu_count": 128,
4+
"cpu_memory_in_gbs": 4096,
5+
"gpu_count": 8,
6+
"gpu_memory_in_gbs": 1440,
7+
"gpu_type": "B200",
8+
"quantization": [
9+
"fp4",
10+
"fp8",
11+
"fp16",
12+
"bf16",
13+
"tf32",
14+
"int8",
15+
"fp64"
16+
],
17+
"ranking": {
18+
"cost": 120,
19+
"performance": 130
20+
}
21+
},
22+
"BM.GPU.GB200.4": {
23+
"cpu_count": 144,
24+
"cpu_memory_in_gbs": 1024,
25+
"gpu_count": 4,
26+
"gpu_memory_in_gbs": 768,
27+
"gpu_type": "GB200",
28+
"quantization": [
29+
"fp4",
30+
"fp8",
31+
"fp6",
32+
"int8",
33+
"fp16",
34+
"bf16",
35+
"tf32",
36+
"fp64"
37+
],
38+
"ranking": {
39+
"cost": 110,
40+
"performance": 120
41+
}
42+
},
43+
"BM.GPU4.8": {
44+
"cpu_count": 64,
45+
"cpu_memory_in_gbs": 2048,
46+
"gpu_count": 8,
47+
"gpu_memory_in_gbs": 320,
48+
"gpu_type": "A100",
49+
"quantization": [
50+
"int8",
51+
"fp16",
52+
"bf16",
53+
"tf32"
54+
],
55+
"ranking": {
56+
"cost": 57,
57+
"performance": 65
58+
}
59+
},
60+
"VM.GPU3.8": {
61+
"cpu_count": 24,
62+
"cpu_memory_in_gbs": 768,
63+
"gpu_count": 8,
64+
"gpu_memory_in_gbs": 128,
65+
"gpu_type": "V100",
66+
"quantization": [
67+
"gptq",
68+
"bitblas",
69+
"aqlm",
70+
"bitsandbytes",
71+
"deepspeedfp",
72+
"gguf"
73+
],
74+
"ranking": {
75+
"cost": 56,
76+
"performance": 46
77+
}
78+
},
279
"shapes": {
380
"BM.GPU.A10.4": {
81+
"cpu_count": 64,
82+
"cpu_memory_in_gbs": 1024,
483
"gpu_count": 4,
584
"gpu_memory_in_gbs": 96,
685
"gpu_type": "A10",
@@ -21,6 +100,8 @@
21100
}
22101
},
23102
"BM.GPU.A100-V2.8": {
103+
"cpu_count": 128,
104+
"cpu_memory_in_gbs": 2048,
24105
"gpu_count": 8,
25106
"gpu_memory_in_gbs": 640,
26107
"gpu_type": "A100",
@@ -41,6 +122,8 @@
41122
}
42123
},
43124
"BM.GPU.B4.8": {
125+
"cpu_count": 64,
126+
"cpu_memory_in_gbs": 2048,
44127
"gpu_count": 8,
45128
"gpu_memory_in_gbs": 320,
46129
"gpu_type": "A100",
@@ -61,6 +144,8 @@
61144
}
62145
},
63146
"BM.GPU.H100.8": {
147+
"cpu_count": 112,
148+
"cpu_memory_in_gbs": 2048,
64149
"gpu_count": 8,
65150
"gpu_memory_in_gbs": 640,
66151
"gpu_type": "H100",
@@ -82,6 +167,8 @@
82167
}
83168
},
84169
"BM.GPU.H200.8": {
170+
"cpu_count": 112,
171+
"cpu_memory_in_gbs": 3072,
85172
"gpu_count": 8,
86173
"gpu_memory_in_gbs": 1128,
87174
"gpu_type": "H200",
@@ -103,6 +190,8 @@
103190
}
104191
},
105192
"BM.GPU.L40S-NC.4": {
193+
"cpu_count": 112,
194+
"cpu_memory_in_gbs": 1024,
106195
"gpu_count": 4,
107196
"gpu_memory_in_gbs": 192,
108197
"gpu_type": "L40S",
@@ -124,6 +213,8 @@
124213
}
125214
},
126215
"BM.GPU.L40S.4": {
216+
"cpu_count": 112,
217+
"cpu_memory_in_gbs": 1024,
127218
"gpu_count": 4,
128219
"gpu_memory_in_gbs": 192,
129220
"gpu_type": "L40S",
@@ -145,6 +236,8 @@
145236
}
146237
},
147238
"BM.GPU.MI300X.8": {
239+
"cpu_count": 112,
240+
"cpu_memory_in_gbs": 2048,
148241
"gpu_count": 8,
149242
"gpu_memory_in_gbs": 1536,
150243
"gpu_type": "MI300X",
@@ -158,6 +251,8 @@
158251
}
159252
},
160253
"BM.GPU2.2": {
254+
"cpu_count": 28,
255+
"cpu_memory_in_gbs": 192,
161256
"gpu_count": 2,
162257
"gpu_memory_in_gbs": 32,
163258
"gpu_type": "P100",
@@ -170,6 +265,8 @@
170265
}
171266
},
172267
"VM.GPU.A10.1": {
268+
"cpu_count": 15,
269+
"cpu_memory_in_gbs": 240,
173270
"gpu_count": 1,
174271
"gpu_memory_in_gbs": 24,
175272
"gpu_type": "A10",
@@ -190,6 +287,8 @@
190287
}
191288
},
192289
"VM.GPU.A10.2": {
290+
"cpu_count": 30,
291+
"cpu_memory_in_gbs": 480,
193292
"gpu_count": 2,
194293
"gpu_memory_in_gbs": 48,
195294
"gpu_type": "A10",
@@ -210,6 +309,8 @@
210309
}
211310
},
212311
"VM.GPU2.1": {
312+
"cpu_count": 12,
313+
"cpu_memory_in_gbs": 72,
213314
"gpu_count": 1,
214315
"gpu_memory_in_gbs": 16,
215316
"gpu_type": "P100",
@@ -222,6 +323,8 @@
222323
}
223324
},
224325
"VM.GPU3.1": {
326+
"cpu_count": 6,
327+
"cpu_memory_in_gbs": 90,
225328
"gpu_count": 1,
226329
"gpu_memory_in_gbs": 16,
227330
"gpu_type": "V100",
@@ -239,6 +342,8 @@
239342
}
240343
},
241344
"VM.GPU3.2": {
345+
"cpu_count": 12,
346+
"cpu_memory_in_gbs": 180,
242347
"gpu_count": 2,
243348
"gpu_memory_in_gbs": 32,
244349
"gpu_type": "V100",
@@ -256,6 +361,8 @@
256361
}
257362
},
258363
"VM.GPU3.4": {
364+
"cpu_count": 24,
365+
"cpu_memory_in_gbs": 360,
259366
"gpu_count": 4,
260367
"gpu_memory_in_gbs": 64,
261368
"gpu_type": "V100",

0 commit comments

Comments
 (0)