Skip to content

Commit d0bdf70

Browse files
authored
Collect shape from configuration entry. (#1089)
2 parents 82d8d53 + a0aa1ef commit d0bdf70

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

ads/aqua/modeldeployment/utils.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,25 +135,28 @@ def _fetch_deployment_configs_concurrently(
135135
def _extract_model_shape_gpu(
136136
self, deployment_configs: Dict[str, AquaDeploymentConfig]
137137
):
138-
"""Extracts shape and GPU count details from deployment configurations."""
138+
"""Extracts shape and GPU count details from deployment configurations.
139+
Supported shapes for multi model deployment will be collected from `configuration` entry in deployment config.
140+
"""
139141
model_shape_gpu = {}
140142
deployment = {}
141143

142144
for model_id, config in deployment_configs.items():
145+
multi_deployment_shape = list(config.configuration.keys())
143146
model_shape_gpu[model_id] = {
144147
shape: [
145148
item.gpu_count
146149
for item in config.configuration.get(
147150
shape, ConfigurationItem()
148151
).multi_model_deployment
149152
]
150-
for shape in config.shape
153+
for shape in multi_deployment_shape
151154
}
152155
deployment[model_id] = {
153-
"shape": config.shape,
156+
"shape": multi_deployment_shape,
154157
"configuration": {
155158
shape: config.configuration.get(shape, ConfigurationItem())
156-
for shape in config.shape
159+
for shape in multi_deployment_shape
157160
},
158161
}
159162

tests/unitary/with_extras/aqua/test_deployment.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -499,10 +499,10 @@ class TestDataset:
499499
"deployment_config": {
500500
"model_a": {
501501
"shape": [
502-
"VM.GPU.A10.2",
503-
"VM.GPU.A10.4",
504502
"BM.GPU.A100-v2.8",
505503
"BM.GPU.H100.8",
504+
"VM.GPU.A10.2",
505+
"VM.GPU.A10.4",
506506
],
507507
"configuration": {
508508
"VM.GPU.A10.2": {
@@ -815,13 +815,9 @@ def test_get_multimodel_deployment_config(
815815

816816
@parameterized.expand(
817817
[
818-
[
819-
"shape",
820-
"Unable to determine a valid GPU allocation for the selected models based on their current configurations. Please try selecting a different set of models.",
821-
],
822818
[
823819
"configuration",
824-
"Unable to determine a valid GPU allocation for the selected models based on their current configurations. Please select a different set of models.",
820+
"Unable to determine a valid GPU allocation for the selected models based on their current configurations. Please try selecting a different set of models.",
825821
],
826822
]
827823
)

0 commit comments

Comments
 (0)